One GnuPG/PGP key pair, two emails?

75

32

I have two emails I use frequently, for both of which I'd like to use PGP keys generated/managed by GnuPG. I'd like to avoid creating a different key pair for each email, if possible, as that's unnecessary for my situation, i.e. I use the two emails interchangeably.

Is there a way to do this?

I am using Mac OS X 10.5 and Ubuntu 11.04, and Thunderbird 3.1.10.

Thanks in advance!

Computist

Posted 2011-06-05T15:35:32.577

Reputation: 2 341

Answers

92

If you want to add an user ID to an existing key from the command line (your input is in bold):

  $ gpg --edit-key <key-id>
  gpg> adduid
  Real Name: <name>
  Email address: <email>
  Comment: <comment or Return to none>
  Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
  Enter passphrase: <password>
  gpg> uid <uid>
  gpg> trust
  Your decision? 5
  Do you really want to set this key to ultimate trust? (y/N) y
  gpg> save
$ gpg --send-keys <key-id>

Aluísio A. S. G.

Posted 2011-06-05T15:35:32.577

Reputation: 2 278

Do I have to add new identities to the master key pair or can I add new identities directly to subkeys? – Kal – 2014-08-16T14:14:23.063

2You may also make the old user id the primary user id again by selecting it with uid <uid> and making it primary with primary. – timakro – 2017-09-16T12:59:48.937

The semi-endorsed GUIs like Kleopatra and GPA also have reasonably easy to use controls that perform this action. – Justin – 2018-08-29T17:41:04.943

What does gpg> uid <uid> do? Is <uid> just my email address foo@bar.com? – Computist – 2011-06-06T01:43:42.710

1@lumeng.dev: is the number right before your new user ID (the list is shown after adduid). Once you enter this command, there should be an asterisk near it, indicating that this is the uid trust will operate on. – Aluísio A. S. G. – 2011-06-06T01:51:52.003

12

Assuming that you use Enigmail for GPG support in Thunderbird, you can simply use the "OpenGPG Security" Tab for each of your identities. You can get there via

Account Preferences -> Manage Identities -> Edit.

Alternatively, you can select from the Menu:

 OpenPGP -> Key Management -> [Right-click on your key] -> Manage User IDs

And then add more IDs to your key.

barbaz

Posted 2011-06-05T15:35:32.577

Reputation: 2 696

2Make sure to resend your updated public key to a keyserver – IceArdor – 2016-10-19T19:23:34.247

1Don't forget to add an user ID for the second email address to your key, through OpenPGP -> Manage keys. – user1686 – 2011-06-05T19:48:40.547

@grawity, I added this in the edited answer – Mateng – 2013-08-16T19:58:07.807