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?


  • 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, 2019 at 11:45

2 Answers 2


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]
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.


It is possible that your key/subkey has expired.
Try gpg --edit-key <keyID>
This will show you the expiry of the individual primary and sub keys. If one of them has expired ,

  1. either create a new key (recommended for security)
    2. renew its expiry date.
    This link will help in renewing. https://sites.lafayette.edu/newquisk/archives/504

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.