Update existing GPG key's name and email

Check for existing GPG keys and get the key which you want to update the email.

gpg --list-secret-keys --keyid-format=long

sec ed25519/12345ABCD67890EF 2024-03-04 [SC]
51D19A62EAB0A97D21B975521420DCAC2218D8CF

uid [ultimate] Jii Yoo <rolemadelen@example.com>
ssb cv25519/FGHIJ9K050ABCDE1F23 2024-03-04 [E]

In this case, we’ll use the key 12345ABCD67890EF. Enter the following command to edit the key.

gpg --edit-key 12345ABCD67890EF

Then the you’ll be in GPG prompt session waiting for you to type a command. Type adduid to add the new (or corrected) author name and the email.

gpg> adduid

Then, use deluid to remove the old. You first need to select the user ID.

gpg --edit-key 12345ABCD67890EF
gpg> 1 # choose user ID (1)

sec ed25519/12345ABCD67890EF
created: 2024-03-04 expires: never usage: SC
trust: ultimate validity: ultimate
ssb cv25519/FGHIJ9K050ABCDE1F23
created: 2024-03-04 expires: never usage: E
[ultimate] (1)*. OLD NAME <OLD EMAIL>
[ unknown] (2). NEW NAME <NEW EMAIL>

gpg> deluid

You end up with an updated name and the email. One last thing you need to do is configure how much you trust this key.

gpg> 2 # choose 
gpg> trust

Please decide how far you trust this user to correctly verify other users\' keys
(by looking at passports, checking fingerprints from different sources, etc.)

1 = I don't know or won't say
2 = I do NOT trust
3 = I trust marginally
4 = I trust fully
5 = I trust ultimately
m = back to the main menu

Your decision? 5