From f6eebaceb21f86da331fd502d31ed8445570157f Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 22 Dec 2013 16:31:19 -0800 Subject: [PATCH] Add PGPPacket._serialize_user_id_packet This is the inverse of _parse_user_id_packet. See the _parse_user_id_packet commit for references to RFC 4880. --- gpg-migrate.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gpg-migrate.py b/gpg-migrate.py index e376f8d..95e34c0 100755 --- a/gpg-migrate.py +++ b/gpg-migrate.py @@ -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( -- 2.26.2