I have been trying to use gnupg in PHP to encrypt a file that will be uploaded to an ftp folder. I am currently running on a mac using MAMP and I believe gnupg is installed correctly.
I have a public key from the recipient of the file and when I try to import the key, either as a string literal or from a text file, I get the cryptic 'import failed' message from gnupg.
$gpg = new gnupg();
$gpg->seterrormode(gnupg::ERROR_EXCEPTION);
$gpg->import($key); //throws exception 'import failed'
Is there a better resource for reasons a key would fail to import?
Using GPG Suite, I can successfully import the key, so I believe the key is correct