codekingpro/portable-devtools
114k
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# Multiple Signatures in Cryptographic Message Syntax (CMS)10#11# ASN.1 source from:12# https://www.rfc-editor.org/rfc/rfc5752.txt13# https://www.rfc-editor.org/errata/eid444414#15 16from pyasn1.type import namedtype17from pyasn1.type import univ18 19from pyasn1_modules import rfc503520from pyasn1_modules import rfc565221 22 23class SignAttrsHash(univ.Sequence):24 componentType = namedtype.NamedTypes(25 namedtype.NamedType('algID', rfc5652.DigestAlgorithmIdentifier()),26 namedtype.NamedType('hash', univ.OctetString())27 )28 29 30class MultipleSignatures(univ.Sequence):31 componentType = namedtype.NamedTypes(32 namedtype.NamedType('bodyHashAlg', rfc5652.DigestAlgorithmIdentifier()),33 namedtype.NamedType('signAlg', rfc5652.SignatureAlgorithmIdentifier()),34 namedtype.NamedType('signAttrsHash', SignAttrsHash()),35 namedtype.OptionalNamedType('cert', rfc5035.ESSCertIDv2())36 )37 38 39id_aa_multipleSignatures = univ.ObjectIdentifier('1.2.840.113549.1.9.16.2.51')40 41 42# Map of Attribute Type OIDs to Attributes added to the43# ones that are in rfc5652.py44 45_cmsAttributesMapUpdate = {46 id_aa_multipleSignatures: MultipleSignatures(),47}48 49rfc5652.cmsAttributesMap.update(_cmsAttributesMapUpdate)50 