The first octet of each signature packet is it's version number. That
means we can parse the first octet of the signature packet and use its
value to determine which version we're parsing. From RFC 4880 [1]:
The body of a version 3 Signature Packet contains:
- One-octet version number (3).
- ...
And in the next section [2]:
The body of a version 4 Signature Packet contains:
- One-octet version number (4).
- ...
[1]: http://tools.ietf.org/search/rfc4880#section-5.2.2
[2]: http://tools.ietf.org/search/rfc4880#section-5.2.3
if key_end:
self['secret-key-checksum'] = data[key_end:]
+ def _parse_signature_packet(self, data):
+ self['signature-version'] = data[0]
+ offset = 1
+ raise NotImplementedError(
+ 'signature packet version {}'.format(
+ self['signature-version']))
+
def to_bytes(self):
pass