Delete a uid from a GPG Key

If you have already committed the UID for an already committed GPG key, you will no longer be able to delete the UID (deluid). You are only permitted to revoke it.

Refresh your key from a keyserver. This will restore the UID you thought
you could delete:
    gpg --keyserver pool.sks-keyservers.net -refresh-keys 0xdecafbad
now use gpg to revoke the UID
    gpg --edit-key 0xdecafbad
gpg displays a list of UIDs on the key. Enter the number of the UID you
wish to revoke. The list is redisplayed with an * next to the selected
one. now use the gpg command revuid to revoke:
    Command> revuid
    Really revoke this user ID? (y/N) y
    Please select the reason for the revocation:
      0 = No reason specified
      4 = User ID is no longer valid
      Q = Cancel
    (Probably you want to select 4 here)
    Your decision? 4
Answer the passphrase prompt and 'save' to update your keyring with the
modified key. Now send the key with revoked UID to the keyservers
    gpg --keyserver pool.sks-keyservers.net -send-keys 0xdecafbad

References

3 thoughts on “Delete a uid from a GPG Key”

  1. Many thanks for writing this as it helped answer a question I had. One note, though… at least on Mac OS X, I needed to use two dashes, as in:
    –refresh-keys
    –send-keys
    It did not work if I used only a single dash.

  2. Hmmm…. WordPress seems to be turning two dashes into a single “long” dash (I wrote that previous comment). You really want to use:
    – -refresh-keys
    – -send-keys
    only without any space in between them.

Leave a Reply

Your email address will not be published. Required fields are marked *