offset += unhashed_count
self['signed-hash-word'] = data[offset: offset + 2]
offset += 2
- self['signature'] = data[offset:]
+ self['signature'] = []
+ while offset < len(data):
+ o, mpi = self._parse_multiprecision_integer(data=data[offset:])
+ offset += o
+ self['signature'].append(mpi)
if self['signature-type'] == 'standalone':
self['target'] = None
elif self['signature-type'].endswith(' user id and public-key packet'):
digest, signature = self.key.sign(
data=signed_data, hash_algorithm=self['hash-algorithm'],
signature_algorithm=self['public-key-algorithm'])
- chunks.extend([digest[:2], signature])
+ chunks.append(digest[:2])
+ chunks.extend(
+ self._serialize_multiprecision_integer(integer=integer)
+ for integer in signature)
return b''.join(chunks)
def _serialize_signature_creation_time_signature_subpacket(