[openpgp] Re: Key Flags subpacket interpretation question
Wyllys Ingersoll <[email protected]> Fri, 7 Nov 2025 12:06:37 -0500
| Newsgroups | gmane.ietf.openpgp |
|---|---|
| Message-ID | <CAHRa8=UOGH9xE6UXcZuEtnSELpEsv3NTmzjRFBdoMYeOsSewHw@mail.gmail.com> |
> > > > > >> Implementation code that follows the rules for applying key usage > quickly gets pretty complicated. V6 simplifies it a little with the Direct > Key signature, though. > > Yes, v4 UID logic is a can of worms... > > There is also the language in 5.2.3.10 about enforcing self-signature > subpackets as narrowly as possible. Using that argument, you might even > argue that the key usage flags (like cipher algorithm preferences) are > dependent on which user ID you used to find the key (though if you found > the key via key ID, you're right back in the which-is-primary question). > The specific use case here is when a user needs to select a UID for sending an encrypted message via email (they choose based on UID/email, not KeyID/Fingerprint). If a key has multiple UID packets and they each have different key usage flags, then only a subset of those UIDs can be used if you base the decision solely on the key flags associated with that particular UID. However, as Andrew points out, the key usage on the UID only applies to the primary key in the certificate (considering only V4 keys for now) that signed the UID packet. If the certificate has a subkey with encryption enabled in it's subkey signature, then that subkey could be used to encrypt a message to any of the UIDs and the application could then present all of the UID email addrs as options regardless of their individual key flags. This is where it becomes a gray area - if there are valid subkeys that have encryption flags set but the UID selected says it is only good for sign/cert, should an implementation be able to encrypt a message to that UID with a valid subkey ? -Wyllys _______________________________________________ openpgp mailing list -- [email protected] To unsubscribe send an email to [email protected]