From RFC 4880 [1]:
(1 octet, Boolean)
This is a flag in a User ID's self-signature that states whether
this User ID is the main User ID for this key. It is reasonable for
an implementation to resolve ambiguities in preferences, etc. by
referring to the primary User ID. If this flag is absent, its value
is zero. If more than one User ID in a key is marked as primary,
the implementation may resolve the ambiguity in any way it sees fit,
but it is RECOMMENDED that priority be given to the User ID with the
most recent self-signature.
When appearing on a self-signature on a User ID packet, this
subpacket applies only to User ID packets. When appearing on a
self-signature on a User Attribute packet, this subpacket applies
only to User Attribute packets. That is to say, there are two
different and independent "primaries" -- one for User IDs, and one
for User Attributes.
[1]: http://tools.ietf.org/search/rfc4880#section-5.2.3.19
return ', '.join(
x for x in sorted(subpacket['key-server-preferences']))
+ def _str_primary_user_id_signature_subpacket(self, subpacket):
+ return str(subpacket['primary-user-id'])
+
def _str_key_flags_signature_subpacket(self, subpacket):
return ', '.join(x for x in sorted(subpacket['key-flags']))
if data[0] & 0x80:
subpacket['key-server-preferences'].add('no-modify')
+ def _parse_primary_user_id_signature_subpacket(self, data, subpacket):
+ subpacket['primary-user-id'] = bool(data[0])
+
def _parse_key_flags_signature_subpacket(self, data, subpacket):
subpacket['key-flags'] = set()
if data[0] & 0x1: