Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
rfc7030.py67 linesDownload Raw Back to pyasn1_modules
1#2# This file is part of pyasn1-modules software.3#4# Created by Russ Housley with assistance from asn1ate v.0.6.0.5#6# Copyright (c) 2019, Vigil Security, LLC7# License: http://snmplabs.com/pyasn1/license.html8#9# Enrollment over Secure Transport (EST)10#11# ASN.1 source from:12# https://www.rfc-editor.org/rfc/rfc7030.txt13#14 15from pyasn1.type import constraint16from pyasn1.type import namedtype17from pyasn1.type import univ18 19from pyasn1_modules import rfc565220 21MAX = float('inf')22 23 24# Imports from RFC 565225 26Attribute = rfc5652.Attribute27 28 29# Asymmetric Decrypt Key Identifier Attribute30 31id_aa_asymmDecryptKeyID = univ.ObjectIdentifier('1.2.840.113549.1.9.16.2.54')32 33class AsymmetricDecryptKeyIdentifier(univ.OctetString):34    pass35 36 37aa_asymmDecryptKeyID = Attribute()38aa_asymmDecryptKeyID['attrType'] = id_aa_asymmDecryptKeyID39aa_asymmDecryptKeyID['attrValues'][0] = AsymmetricDecryptKeyIdentifier()40 41 42# CSR Attributes43 44class AttrOrOID(univ.Choice):45    pass46 47AttrOrOID.componentType = namedtype.NamedTypes(48    namedtype.NamedType('oid', univ.ObjectIdentifier()),49    namedtype.NamedType('attribute', Attribute())50)51 52 53class CsrAttrs(univ.SequenceOf):54    pass55 56CsrAttrs.componentType = AttrOrOID()57CsrAttrs.subtypeSpec=constraint.ValueSizeConstraint(0, MAX)58 59   60# Update CMS Attribute Map61 62_cmsAttributesMapUpdate = {63    id_aa_asymmDecryptKeyID: AsymmetricDecryptKeyIdentifier(),64}65 66rfc5652.cmsAttributesMap.update(_cmsAttributesMapUpdate)67