Imported GnuPG keys not working!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
boon4376
Forum Newbie
Posts: 19
Joined: Sun Oct 01, 2006 9:55 pm

Imported GnuPG keys not working!

Post 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??
boon4376
Forum Newbie
Posts: 19
Joined: Sun Oct 01, 2006 9:55 pm

Re: Imported GnuPG keys not working!

Post 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]"
Post Reply