Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
rfc3370.py147 linesDownload Raw Back to pyasn1_modules
1#2# This file is part of pyasn1-modules software.3#4# Created by Russ Housley.5#6# Copyright (c) 2019, Vigil Security, LLC7# License: http://snmplabs.com/pyasn1/license.html8#9# Cryptographic Message Syntax (CMS) Algorithms10#11# ASN.1 source from:12# https://www.rfc-editor.org/rfc/rfc3370.txt13#14 15from pyasn1.type import univ16 17from pyasn1_modules import rfc327918from pyasn1_modules import rfc528019from pyasn1_modules import rfc575120from pyasn1_modules import rfc575321from pyasn1_modules import rfc599022from pyasn1_modules import rfc801823 24 25# Imports from RFC 528026 27AlgorithmIdentifier = rfc5280.AlgorithmIdentifier28 29 30# Imports from RFC 327931 32dhpublicnumber = rfc3279.dhpublicnumber33 34dh_public_number = dhpublicnumber35 36DHPublicKey = rfc3279.DHPublicKey37 38DomainParameters = rfc3279.DomainParameters39 40DHDomainParameters = DomainParameters41 42Dss_Parms = rfc3279.Dss_Parms43 44Dss_Sig_Value = rfc3279.Dss_Sig_Value45 46md5 = rfc3279.md547 48md5WithRSAEncryption = rfc3279.md5WithRSAEncryption49 50RSAPublicKey = rfc3279.RSAPublicKey51 52rsaEncryption = rfc3279.rsaEncryption53 54ValidationParms = rfc3279.ValidationParms55 56id_dsa = rfc3279.id_dsa57 58id_dsa_with_sha1 = rfc3279.id_dsa_with_sha159 60id_sha1 = rfc3279.id_sha161 62sha_1 = id_sha163 64sha1WithRSAEncryption = rfc3279.sha1WithRSAEncryption65 66 67# Imports from RFC 575368 69CBCParameter = rfc5753.CBCParameter70 71CBCParameter = rfc5753.IV72 73KeyWrapAlgorithm = rfc5753.KeyWrapAlgorithm74 75 76# Imports from RFC 599077 78id_alg_CMS3DESwrap = rfc5990.id_alg_CMS3DESwrap79 80 81# Imports from RFC 801882 83des_EDE3_CBC = rfc8018.des_EDE3_CBC84 85des_ede3_cbc = des_EDE3_CBC86 87rc2CBC = rfc8018.rc2CBC88 89rc2_cbc = rc2CBC90 91RC2_CBC_Parameter = rfc8018.RC2_CBC_Parameter92 93RC2CBCParameter = RC2_CBC_Parameter94 95PBKDF2_params = rfc8018.PBKDF2_params96 97id_PBKDF2 = rfc8018.id_PBKDF298 99 100# The few things that are not already defined elsewhere101 102hMAC_SHA1 = univ.ObjectIdentifier('1.3.6.1.5.5.8.1.2')103 104 105id_alg_ESDH = univ.ObjectIdentifier('1.2.840.113549.1.9.16.3.5')106 107 108id_alg_SSDH = univ.ObjectIdentifier('1.2.840.113549.1.9.16.3.10')109 110 111id_alg_CMSRC2wrap = univ.ObjectIdentifier('1.2.840.113549.1.9.16.3.7')112 113 114class RC2ParameterVersion(univ.Integer):115    pass116 117 118class RC2wrapParameter(RC2ParameterVersion):119    pass120 121 122class Dss_Pub_Key(univ.Integer):123    pass124 125 126# Update the Algorithm Identifier map in rfc5280.py.127 128_algorithmIdentifierMapUpdate = {129    hMAC_SHA1: univ.Null(""),130    id_alg_CMSRC2wrap: RC2wrapParameter(),131    id_alg_ESDH: KeyWrapAlgorithm(),132    id_alg_SSDH: KeyWrapAlgorithm(),133}134 135rfc5280.algorithmIdentifierMap.update(_algorithmIdentifierMapUpdate)136 137 138# Update the S/MIME Capabilities map in rfc5751.py.139 140_smimeCapabilityMapUpdate = {141    id_alg_CMSRC2wrap: RC2wrapParameter(),142    id_alg_ESDH: KeyWrapAlgorithm(),143    id_alg_SSDH: KeyWrapAlgorithm(),144}145 146rfc5751.smimeCapabilityMap.update(_smimeCapabilityMapUpdate)147 
codekingpro/portable-devtools · Team Ai