Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #18952

Re: gnupg::encrypt(): get_key failed

Path csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From "J.O. Aho" <user@example.net>
Newsgroups comp.lang.php
Subject Re: gnupg::encrypt(): get_key failed
Date Sat, 28 May 2022 23:39:54 +0200
Lines 45
Message-ID <jffj5bF3q3oU1@mid.individual.net> (permalink)
References <t6sljc$1i9$1@gioia.aioe.org> <t6sm26$9bp$1@dont-email.me> <t6t1i1$l52$1@gioia.aioe.org>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 8bit
X-Trace individual.net YTEfF8fpRhthS2BlPTpTUQ0B4KAaYhJjNyxCN3E1Sx6l1M61DG
Cancel-Lock sha1:4jidCwzR6Wg1lau0U2Cp6JONm4c=
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0
Content-Language en-US-large
In-Reply-To <t6t1i1$l52$1@gioia.aioe.org>
Xref csiph.com comp.lang.php:18952

Show key headers only | View raw


On 28/05/2022 13.37, Fx ROOM wrote:

> In any case
> 
> $ echo $GNUPGHOME
> /tmp/key4656
> 
> $ mkdir /tmp/key4656
> 
> $ cat encrypt
> #!/usr/bin/php
> <?php
> $gpg = new gnupg();
> $gpg->addencryptkey("8660281B6051D071D94B5B230549F9DC851566DC");

I see you just copied the example from php.net, the fingerprint has to 
belong to one of the pgp keys that is in the users default keystorage or 
one that is assigned by setting the GNUPGHOME environment variable.

As you will never have the same fingerprint for the key as the one used 
in the example, the example will never work.


What you need to do is to create a new pgp key with gpg and then use the 
fingerprint for the public key as the argument for your addencryptkey().



> Also if it serves something
> 
> $ tree ~/.ssh
> ├── authorized_keys
> ├── id_rsa2
> ├── id_rsa.pub
> └── known_hosts

No, that ain't the same as pgp keys (the above are ssl), I would suggest 
you take a loot at the gpg man page, just type in your terminal: man gpg
or you can visit the following page: https://manpages.org/gpg


-- 

   //Aho

Back to comp.lang.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

gnupg::encrypt(): get_key failed Fx ROOM <naso@tata.new> - 2022-05-28 10:13 +0200
  Re: gnupg::encrypt(): get_key failed De ongekruisigde <ongekruisigde@news.eternal-september.org> - 2022-05-28 08:21 +0000
    Re: gnupg::encrypt(): get_key failed Fx ROOM <naso@tata.new> - 2022-05-28 13:37 +0200
      Re: gnupg::encrypt(): get_key failed "J.O. Aho" <user@example.net> - 2022-05-28 23:39 +0200
        Re: gnupg::encrypt(): get_key failed Fx ROOM <naso@tata.new> - 2022-05-29 12:07 +0200

csiph-web