As discussed on IRC:
I am generating a key via CLI and found it to be a little quirky.
gpg --status-file status --quick-gen-key "Name <foo@gmail.com>" rsa4096 cert,sign never FPR=$(awk '($2=="KEY_CREATED") { print $4 }' < status) gpg --quick-add-uid foo@gmail.com "Name <bar@gmail.com>" gpg --quick-add-key $FPR rsa4096 sign 2y
While the above works the addressing of the target key is inconsistent between --quick-add-uid and --quick-add-key. What I would love to see instead is that this works:
gpg --quick-gen-key "Name <foo@gmail.com>" rsa4096 cert,sign never gpg --quick-add-uid foo@gmail.com "Name <bar@gmail.com>" gpg --quick-add-key foo@gmail.com rsa4096 sign 2y
It would throw an error if the search via email is not distinct. Which leads to what also should be possible:
gpg --quick-add-uid $FPR "Name <bar@gmail.com>" gpg --quick-add-key $FPR rsa4096 sign 2y
For getting to the fingerprint of the key I'd like to see at least one of the following options (or something similar):
FPR=$(gpg --print-fingerprint --quick-gen-key "Name <foo@gmail.com>" rsa4096 cert,sign never) FPR=$(gpg --fingerprint foo@gmail.com --print-fingerprint)
Because extracting the fingerprint from a status file or a pretty print isn't exactly nice.