I was trying to encrypt a file using a GPG public key.
It's working fine on my test server which is ubuntu 18.04 but when I try to use the same key on my production server (Amazon Linux) it failed to encrypt with a message
gpg: 40BXFE61: skipped: Unusable public key
There are other keys that are working fine, having problem with this key only.
I've already tried by trusting the keys (ultimate) and having expiry (Never).
Any suggestion or advice?
Thanks
gpg -v --debug lookup
flags. This should help identify the issue better. My guess is that the key does not have a flag set to allow it being used for encryption. Can you sign a file with it?