Add PGPPacket._serialize_user_id_packet
authorW. Trevor King <wking@tremily.us>
Mon, 23 Dec 2013 00:31:19 +0000 (16:31 -0800)
committerW. Trevor King <wking@tremily.us>
Mon, 23 Dec 2013 21:41:06 +0000 (13:41 -0800)
This is the inverse of _parse_user_id_packet.  See the
_parse_user_id_packet commit for references to RFC 4880.

gpg-migrate.py

index e376f8d5bf3bccc2086699f185d8ce6a39759163..95e34c03ac870b4237017584992d2a32fbd42c16 100755 (executable)
@@ -923,6 +923,9 @@ class PGPPacket (dict):
                     self['public-key-algorithm']))
         return b''.join(chunks)
 
+    def _serialize_user_id_packet(self):
+        return self['user'].encode('utf-8')
+
     def _string_to_key(self, string, key_size):
         if key_size % 8:
             raise ValueError(