From 32f36d4ec505b385c880eb99ad69a8cde93f14fb Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 19 Dec 2013 21:08:26 -0800 Subject: [PATCH] Add PGPPacket._public_key_algorithms From RFC 4880 [1]: ID Algorithm -- --------- 1 - RSA (Encrypt or Sign) [HAC] 2 - RSA Encrypt-Only [HAC] 3 - RSA Sign-Only [HAC] 16 - Elgamal (Encrypt-Only) [ELGAMAL] [HAC] 17 - DSA (Digital Signature Algorithm) [FIPS186] [HAC] 18 - Reserved for Elliptic Curve 19 - Reserved for ECDSA 20 - Reserved (formerly Elgamal Encrypt or Sign) 21 - Reserved for Diffie-Hellman (X9.42, as defined for IETF-S/MIME) 100 to 110 - Private/Experimental algorithm [1]: http://tools.ietf.org/search/rfc4880#section-9.1 --- gpg-migrate.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gpg-migrate.py b/gpg-migrate.py index 066463b..9c8bca6 100755 --- a/gpg-migrate.py +++ b/gpg-migrate.py @@ -51,6 +51,29 @@ class PGPPacket (dict): 63: 'private', } + _public_key_algorithms = { + 1: 'rsa (encrypt or sign)', + 2: 'rsa encrypt-only', + 3: 'rsa sign-only', + 16: 'elgamal (encrypt-only)', + 17: 'dsa (digital signature algorithm)', + 18: 'reserved for elliptic curve', + 19: 'reserved for ecdsa', + 20: 'reserved (formerly elgamal encrypt or sign)', + 21: 'reserved for diffie-hellman', + 100: 'private', + 101: 'private', + 102: 'private', + 103: 'private', + 104: 'private', + 105: 'private', + 106: 'private', + 107: 'private', + 108: 'private', + 109: 'private', + 110: 'private', + } + _clean_type_regex = _re.compile('\W+') def _clean_type(self): -- 2.26.2