From: W. Trevor King Date: Fri, 20 Dec 2013 05:27:27 +0000 (-0800) Subject: Decode public key algorithm in _parse_generic_public_key_packet X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e506052433418c27c3cbf48b859f6027cf18edf8;p=gpg-migrate.git Decode public key algorithm in _parse_generic_public_key_packet It's easier for humans to parse the text representation ;). --- diff --git a/gpg-migrate.py b/gpg-migrate.py index e75cab8..d2049c2 100755 --- a/gpg-migrate.py +++ b/gpg-migrate.py @@ -201,9 +201,10 @@ class PGPPacket (dict): 'public (sub)key packet version {}'.format( self['key-version'])) length = 5 - self['creation_time'], self['public-key-algorithm'] = _struct.unpack( + self['creation-time'], algorithm = _struct.unpack( '>IB', data[offset: offset + length]) offset += length + self['public-key-algorithm'] = self._public_key_algorithms[algorithm] self['key'] = data[offset:] def to_bytes(self):