0

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

  • Please run the command you were trying to run using 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? – MechMK1 Oct 9 at 11:45
1

My guess would be that you are trying to use an ECC key (or subkey). The version of gnupg that comes with Amazon Linux is too old to support ECC cryptography. If you look at the output of gpg --list-key 40BXFE61, you can check for any pub or sub entries that have cv25519 or nistp256 in them, e.g.:

pub   rsa4096/E63EDCA9329DD07E 2011-11-07 [SC]
      DE0E66E32F1FDD0902666B96E63EDCA9329DD07E
uid                 [ultimate] Konstantin Ryabitsev <konstantin@linuxfoundation.org>
sub   rsa4096/0BED129D9916360E 2015-11-02 [A]
sub   ed25519/B6C41CE35664996C 2018-02-09 [S]
sub   cv25519/86D203575A83079D 2018-05-02 [E]
sub   rsa2048/3FF293496E43D963 2018-05-02 [A]

GnuPG 2.0 and earlier only have support for RSA/DSA keys. Unfortunately, there isn't much you can do to support ECC keys on Amazon Linux, short of building gnupg-2.2+ on your own.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.