From: W. Trevor King Date: Fri, 20 Dec 2013 19:28:42 +0000 (-0800) Subject: Add user id parsing to PGPPacket X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=62918ab781f90f4e8322083b1de60422fe71f1c2;p=gpg-migrate.git Add user id parsing to PGPPacket From RFC 4880 [1]: A User ID packet consists of UTF-8 text that is intended to represent the name and email address of the key holder. By convention, it includes an RFC 2822 [RFC2822] mail name-addr, but there are no restrictions on its content. The packet length in the header specifies the length of the User ID. [1]: http://tools.ietf.org/search/rfc4880#section-5.11 --- diff --git a/gpg-migrate.py b/gpg-migrate.py index 3df8990..fb5ea92 100755 --- a/gpg-migrate.py +++ b/gpg-migrate.py @@ -395,6 +395,9 @@ class PGPPacket (dict): offset += 2 self['signature'] = data[offset:] + def _parse_user_id_packet(self, data): + self['user'] = str(data, 'utf-8') + def to_bytes(self): pass