The fact that I have to ask about this after plowing down so many hours into this already tells me that at least one of these two statements is true:
- I'm doing something horribly wrong.
- PGP/GPG is an absolute mess which purposedly makes it as difficult and confusing to work with as possible.
Basically, my system automatically imports any PGP public key blocks sent to me, for the purpose of being able to encrypt messages automatically when they are going out (sent from me as a reply).
When you encrypt a plaintext message with PGP/GPG, you tell the program which "receiver" to use. This confusing term actually refers to the "full name + e-mail address" field (which is for some reason called "user name") in a public key stored in GPG.
Well, when I "import" such a PGP public key block (which works), I have no idea what the "user name" field is, and if I don't know that, I can't actually use it, since the encryption feature wants me to refer to the correct "stored public key".
But how do I actually extract the "user name" field from the public key? You'd think it would return this when you do the --import command, but as far as I can tell, it doesn't. And I've been digging for hours and hours in the manual without finding anything related to this.
For the record, I did find this StackOverflow thread: https://security.stackexchange.com/questions/50965/extracting-the-gpg-userid-from-the-public-key-file ... but it makes absolutely no sense to me. The "solution" already knows about and specifies some kind of id, which seems to defeat the whole point since that's essentially what we are trying to find (except it's the "user name" field).
I've seen all kinds of "common/useful PGP/GPG commands" and none of them even mention this whatsoever. Huh? This is like the most basic and crucial task... I'm very confused. Why doesn't the --import command give me any kind of id to use? Does it, but in some convoluted way?
pgp --list-keys
.