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, LLC 7# License: http://snmplabs.com/pyasn1/license.html 8# 9# Enrollment over Secure Transport (EST) 10# 11# ASN.1 source from: 12# https://www.rfc-editor.org/rfc/rfc7030.txt 13# 14 15from pyasn1.type import constraint 16from pyasn1.type import namedtype 17from pyasn1.type import univ 18 19from pyasn1_modules import rfc5652 20 21MAX = float('inf') 22 23 24# Imports from RFC 5652 25 26Attribute = rfc5652.Attribute 27 28 29# Asymmetric Decrypt Key Identifier Attribute 30 31id_aa_asymmDecryptKeyID = univ.ObjectIdentifier('1.2.840.113549.1.9.16.2.54') 32 33class AsymmetricDecryptKeyIdentifier(univ.OctetString): 34 pass 35 36 37aa_asymmDecryptKeyID = Attribute() 38aa_asymmDecryptKeyID['attrType'] = id_aa_asymmDecryptKeyID 39aa_asymmDecryptKeyID['attrValues'][0] = AsymmetricDecryptKeyIdentifier() 40 41 42# CSR Attributes 43 44class AttrOrOID(univ.Choice): 45 pass 46 47AttrOrOID.componentType = namedtype.NamedTypes( 48 namedtype.NamedType('oid', univ.ObjectIdentifier()), 49 namedtype.NamedType('attribute', Attribute()) 50) 51 52 53class CsrAttrs(univ.SequenceOf): 54 pass 55 56CsrAttrs.componentType = AttrOrOID() 57CsrAttrs.subtypeSpec=constraint.ValueSizeConstraint(0, MAX) 58 59 60# Update CMS Attribute Map 61 62_cmsAttributesMapUpdate = { 63 id_aa_asymmDecryptKeyID: AsymmetricDecryptKeyIdentifier(), 64} 65 66rfc5652.cmsAttributesMap.update(_cmsAttributesMapUpdate) 67