Remove a user id from a pgp key along gpg4win

Gpg4win, we’re speaking Windows here, comes with Kleopatra, a Qt-App from the KDE realm, to manage keys, called certificates, encrypt/decrypt/verify files and mails and so forth. Kleopatra is a nice piece of software and supplies almost any functionality you need in the branch. However, concerning certificate user id’s, mostly names and email-adresses in this context, Kleopatra does yet only provide adding. A delete or update (delete/insert) has not yet been instrumented (*1).
Fortunately, Gpg4win does include a full distrubution of GnuPG located as c:\Program Files (x86)\GnuPG, such that we have the full toolset of the used-to gpg command line at our disposal. According to https://crypto.stackexchange.com/questions/9403/how-can-i-remove-my-personal-data-from-my-pgp-public-key , we just need a couple of commands to delete user id #1 as follows:

C:\Windows\System32>gpg -k
C:/Users/???/AppData/Roaming/gnupg/pubring.kbx
-----------------------------------------------
pub   ??? ??? [SC]
      ???
uid        [ ultimativ ] ??? <???>
uid        [ ultimativ ] ??? <???>
sub   ??? ??? [E]

C:\Windows\System32>gpg --edit-key ???
Geheimer Schlüssel ist vorhanden.
sec ...
[ ultimativ ] (1). ??? <???>
[ ultimativ ] (2)  ??? <???>

gpg> uid 1
sec ...
[ ultimativ ] (1)* ??? <???>
[ ultimativ ] (2)  ??? <???>

gpg> deluid
Diese User-ID wirklich entfernen? (j/N) j
sec ...
[ ultimativ ] (1)  ??? <???>

gpg> save

Kleopatra will notice ad hoc, cool. Enigmail does only show the primary user id anyway, so it might change in view, depending on the level of the user id deleted.

Have fun

(*1) If you’re with key servers, you should better think of revoking user id’s because in a key server environment, key metadata will always be merged to a set union. That is, nothing will be deleted really.

Ps. If you’re also suprised to find Kleopatra running in german but by principle prefer english for efficient wording, do find the language settings NOT Settings BUT with the Help main menu item 😉

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.