Blog | G5 Cyber Security

Add Email to GPG Key

TL;DR

Yes, you can add an email address to your existing GPG key using the gpg --edit-key command. This guide shows you how.

How to Add an Email Address to Your GPG Key

  1. Open your key for editing: Use the following command, replacing your_email@example.com with the email address associated with your key (or one of them if you have multiple).
    gpg --edit-key your_email@example.com
  2. Enter edit mode: Once the key is loaded, you’ll be in the GPG editing prompt. Type list to see a list of commands.
  3. Add user ID: To add your email address as a new User ID (which includes your name and email), type uid and press Enter. You will then be prompted for your full name, comment, and finally the email address.
    gpg> uid
    Please enter what to do (Change UID/Add UID/Delete UID): Add UID
    Your name:
    Real name: Your Full Name
    Email: your_email@example.com
    Comment: (optional)
    
  4. Confirm the User ID: GPG will display the new User ID you’ve entered. Confirm it is correct.
  5. Save the changes: Type save and press Enter to save your changes.
    gpg> save
    
  6. Exit GPG: Type quit and press Enter to exit the editing session.
    gpg> quit
    
  7. Verify the changes: Use the following command to list your keys and confirm that the new email address is associated with your key.
    gpg --list-keys your_email@example.com

Important Considerations

Exit mobile version