To cut a long story short, I have a user "mpo" who has a folder ~mpo/.gnupg (~mpo = /home/mpo) that contains her pubring.gpg and secring.gpg files. I am trying to write a Perl CGI program using the latest OpenPGP and gpg installations to encrypt a block of text using a KeyID in her keyrings and email it back to her. Is there a way to encrypt a message using a KeyID that is in these specific files i.e. ~mpo/.gnupg/secring.gpg and ~mpo/.gnupg/pubring.gpg?
I have tried gpg --homedir ~mpo/.gnupg --list-keys and the key I want to use with ID 05C1F245 is definitely there.