From a080f0bfbcd43a84a95e6118e0b258dd2184f28d Mon Sep 17 00:00:00 2001 From: Russ Housley Date: Mon, 21 Oct 2019 16:13:24 -0400 Subject: Updated the handling of maps for use with openType for RFC 3279 (#89) --- pyasn1_modules/rfc3279.py | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'pyasn1_modules') diff --git a/pyasn1_modules/rfc3279.py b/pyasn1_modules/rfc3279.py index 428c0e8..f6e24de 100644 --- a/pyasn1_modules/rfc3279.py +++ b/pyasn1_modules/rfc3279.py @@ -4,12 +4,19 @@ # Copyright (c) 2017, Danielle Madeley # License: http://snmplabs.com/pyasn1/license.html # -# Derived from RFC 3279 +# Modified by Russ Housley to add maps for use with opentypes. +# +# Algorithms and Identifiers for Internet X.509 Certificates and CRLs +# +# Derived from RFC 3279: +# https://www.rfc-editor.org/rfc/rfc3279.txt # from pyasn1.type import namedtype from pyasn1.type import namedval from pyasn1.type import univ +from pyasn1_modules import rfc5280 + def _OID(*components): output = [] @@ -231,3 +238,23 @@ prime239v1 = _OID(primeCurve, 4) prime239v2 = _OID(primeCurve, 5) prime239v3 = _OID(primeCurve, 6) prime256v1 = _OID(primeCurve, 7) + + +# Map of Algorithm Identifier OIDs to Parameters added to the +# ones in rfc5280.py. Do not add OIDs with absent paramaters. + +_algorithmIdentifierMapUpdate = { + md2: univ.Null(""), + md5: univ.Null(""), + id_sha1: univ.Null(""), + id_dsa: Dss_Parms(), + rsaEncryption: univ.Null(""), + md2WithRSAEncryption: univ.Null(""), + md5WithRSAEncryption: univ.Null(""), + sha1WithRSAEncryption: univ.Null(""), + dhpublicnumber: DomainParameters(), + id_keyExchangeAlgorithm: KEA_Parms_Id(), + id_ecPublicKey: EcpkParameters(), +} + +rfc5280.algorithmIdentifierMap.update(_algorithmIdentifierMapUpdate) -- cgit v1.2.3