def _str_issuer_signature_subpacket(self, subpacket):
return subpacket['issuer'][-8:].upper()
+ def _str_key_flags_signature_subpacket(self, subpacket):
+ return ', '.join(x for x in sorted(subpacket['key-flags']))
+
def _str_embedded_signature_signature_subpacket(self, subpacket):
return subpacket['embedded']['signature-type']
def _parse_issuer_signature_subpacket(self, data, subpacket):
subpacket['issuer'] = ''.join('{:02x}'.format(byte) for byte in data)
+ def _parse_key_flags_signature_subpacket(self, data, subpacket):
+ subpacket['key-flags'] = set()
+ if data[0] & 0x1:
+ subpacket['key-flags'].add('can certify')
+ if data[0] & 0x2:
+ subpacket['key-flags'].add('can sign')
+ if data[0] & 0x4:
+ subpacket['key-flags'].add('can encrypt communications')
+ if data[0] & 0x8:
+ subpacket['key-flags'].add('can encrypt storage')
+ if data[0] & 0x10:
+ subpacket['key-flags'].add('private split')
+ if data[0] & 0x20:
+ subpacket['key-flags'].add('can authenticate')
+ if data[0] & 0x80:
+ subpacket['key-flags'].add('private shared')
+
def _parse_embedded_signature_signature_subpacket(self, data, subpacket):
subpacket['embedded'] = PGPPacket()
subpacket['embedded']._parse_signature_packet(data=data)