Imported GnuPG keys not working, help

boon4376

Registered
Sep 29, 2010
2
0
51
When I import a GnuPG key, i cant do anything with it with my scripts. Just nothing happens. If I generate the key inside CPANEL, my script works fine.

if I generate a key in CPANEL, delete it, and re-import it, it doesn't work... Imported keys are not working for me for some reason.

I am encrypting a file that I will need to send and I need to get my clients GnuPG key installed on my server...

I am using PHP:
echo shell_exec("gpg -e -r $recipient $file");

Anyone experience this problem before?
 

boon4376

Registered
Sep 29, 2010
2
0
51
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]"