I'm getting an error in decrypting .gpg file. I've already imported the public keys through below method.
$gpg --import key1.asc directory `/user_home/.gnupg' created gpg: new configuration file `/user_home/.gnupg/gpg.conf' created gpg: WARNING: options in `/user_home/.gnupg/gpg.conf' are not yet active during this run gpg: keyring `/user_home/.gnupg/secring.gpg' created gpg: keyring `/user_home/.gnupg/pubring.gpg' created gpg: /user_home/.gnupg/trustdb.gpg: trustdb created gpg: key 3CDDKLPD: public key imported gpg: Total number processed: 1 gpg:imported: 1 (RSA: 1) $gpg --import key2.asc gpg: key 4F23B654: public key imported gpg: Total number processed: 1 gpg: imported: 1 (RSA: 1) $gpg --list-public-keys /user_home/.gnupg/pubring.gpg pub 2048R/3CDDKLPD uid pub 2048R/4F23B654 uid $gpg --decrypt myfile.txt.gpg gpg: encrypted with 2048-bit RSA key, ID 4F23B654, created 2010-07-11 gpg: decryption failed: No secret keykey
This error occurs though so, can someone help determine why this is happening? I will appreciate it.