Page 1 of 1

Imported GnuPG keys not working!

Posted: Wed Sep 29, 2010 8:55 pm
by boon4376
I have imported a GnuPG key via CPANEL and I cannot get it to work. I am encrypting a file.

The script works fine when using a key that I generate inside CPANEL, however when I import a key, even a key previously imported in CPANEL, I am unable to encrypt anything.

Code: Select all

echo shell_exec("gpg -e -r $recipient $file");
Anyone experience this problem before? How do I import a key properly??

Re: Imported GnuPG keys not working!

Posted: Wed Sep 29, 2010 9:21 pm
by boon4376
SOLVED

I found the problem. When importing keys in CPANEL, they are not signed. If using SSH, it asks you if you are sure you want to use the unverified key and you can type "y"... In PHP you cannot confirm this and it never executes... and it never tells you this either.

The key must be "signed" and then the script will execute without asking.

I needed to sign the key with this command in ssh
"gpg --sign-key [recipient]"