newbie question "Public key not found" with PHP
Tue, 12 Dec 2000 17:58:01 -0800
How did you set it up - running under your username or under the PHP user
"nobody"? If you access it with php it wants "nobody's" keyring. I set it
all up through scripts like so: (easy as all heck)
echo exec("/usr/bin/gpg -vv --homedir /path/to/mydir/.gnupg --gen-key
echo "<b>response to --gen-key:</b><br>";
while( $res=each($e) )
echo exec("/usr/bin/gpg -vv --homedir /path/to/mydir/.gnupg --import
echo "<br><b>response to import:</b><br>";
while( $res=each($e) )
I also tried setting the environment variable as well and that works too.
I hope you find some of this useful,
To the group -> This is a great program but i think that it would be helpful
to have another mailing list dedicated to CGI so as to separate these issues
from the critical encryption issues. Any takers?
----- Original Message -----
From: "Tom Beidler" <firstname.lastname@example.org>
Sent: Tuesday, December 12, 2000 1:30 PM
Subject: newbie question "Public key not found" with PHP
> Please CC me. I'm not sure if I'm subscribed yet.
> I'm having problems using GNUPG for the first time. I'm using it with PHP
> and I'll show you my code;
> // Set directory for "www"'s key ring
> // Dump email message into indata file
> $fp = fopen("/usr/home/dogma/temp/indata", "w+");
> fputs($fp, $msg);
> // encrypt
> system("/usr/local/bin/gpg --encrypt -ao /usr/home/dogma/temp/outdata -r
> 'Joe Schmoe <email@example.com>' /usr/home/dogma/temp/indata ");
> $crypted = "/usr/home/dogma/temp/outdata";
> $fd = fopen($crypted, "r");
> $mail_cont = fread($fd, filesize($crypted));
> I keep getting "Public key not found". The key lines are the "putenv"
> is the directory of the PHP users key ring and "system" which is the
> command line. I've tried several variations of the public key, ie. 'Joe',
> 'Joe Schmoe', 'firstname.lastname@example.org'.
> I've tried telneting in as myself and encrypting something and I get the
> samething. When I --check-ring it shows that I have both my private and
> public key.
> Any help would be appreciated.
> Tom Beidler
> Orbit Tech Services
> 805.455.7119 (cell)
> 805.682.8972 (phone)
> 805.682.5833 (fax)
> Archive is at http://lists.gnupg.org - Unsubscribe by sending mail
> with a subject of "unsubscribe" to email@example.com
Archive is at http://lists.gnupg.org - Unsubscribe by sending mail
with a subject of "unsubscribe" to firstname.lastname@example.org