UID management

David Shaw dshaw at jabberwocky.com
Tue Nov 6 05:27:36 CET 2007


On Mon, Nov 05, 2007 at 06:18:33PM +0100, Philipp Gühring wrote:
> Hi,
> 
> Thanks for your answer!
> 
> Ok, I need the following: 
> 1. I need a tool that lists me all the UIDs in a key. 
> 2. Then I select the UIDs I need, and the UIDs I do not need
> 3. Then I need a tool that removes all selected unneeded UIDs from the key, 
> and returns me the stripped key.
> 
> Until now I tried the do the first step with gpg --with-colons and the third 
> step with gpg --edit-key by automating gpg. 
> But due to the ordering problem, this doesn´t work.

The ordering does not matter.  GPG supports selecting a user ID by hash:

gpg --with-colons --list-keys (whatever)

....
uid:-::::2006-08-02::A8DCEA454269C4701E724839B04AEDD404BC21EB::Foo Bar <foo at example.com>:
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^
                      this is the hash value


gpg --edit-key (whatever)
uid A8DCEA454269C4701E724839B04AEDD404BC21EB
deluid
save

David



More information about the Gnupg-users mailing list