I have multiple OpenPGP keys that I am managing with GPG. The problem is, they have the same user ID and the same e-mail address. How do I tell GPG the difference when I am, say, encrypting a file?


You can always use a key ID instead of a user ID. For example, for encrypting a message to my newer key:

gpg --encrypt --recipient A4FF2279

In case of ambiguous key IDs, you might need to use a longer id or the full fingerprint.

| improve this answer | |
  • But why doesn't gpg warn me about the ambiguity if I just use the email address test@example.com in gpg --recipient someone@example.com --local-user test@example.com --armor --sign --encrypt --verbose test.txt ? pgp just use the first one found. – schemacs Jan 11 at 11:28

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.