o, mpi = self._parse_multiprecision_integer(data=data[offset:])
offset += o
self['signature'].append(mpi)
+ if self.key.secret_packets:
+ packets = self.key.secret_packets
+ else:
+ packets = self.key.public_packets
if self['signature-type'] == 'standalone':
self['target'] = None
elif self['signature-type'].endswith(' user id and public-key packet'):
self['target'] = [
- [p for p in self.key.public_packets if p['type'] == 'public-key packet'][-1],
- [p for p in self.key.public_packets if p['type'] == 'user id packet'][-1],
+ packets[0],
+ [p for p in packets if p['type'] == 'user id packet'][-1],
+ ]
+ elif self['signature-type'].endswith('key binding'):
+ self['target'] = [
+ packets[0],
+ [p for p in packets if p['type'] == 'public-subkey packet'][-1],
]
else:
raise NotImplementedError(