Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
rfc6032.py69 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# CMS Encrypted Key Package Content Type10#11# ASN.1 source from:12# https://www.rfc-editor.org/rfc/rfc6032.txt13#14 15from pyasn1.type import namedtype16from pyasn1.type import tag17from pyasn1.type import univ18 19from pyasn1_modules import rfc565220from pyasn1_modules import rfc508321 22 23# Content Decryption Key Identifier attribute24 25id_aa_KP_contentDecryptKeyID = univ.ObjectIdentifier('2.16.840.1.101.2.1.5.66')26 27class ContentDecryptKeyID(univ.OctetString):28    pass29 30aa_content_decrypt_key_identifier = rfc5652.Attribute()31aa_content_decrypt_key_identifier['attrType'] = id_aa_KP_contentDecryptKeyID32aa_content_decrypt_key_identifier['attrValues'][0] = ContentDecryptKeyID()33 34 35# Encrypted Key Package Content Type36 37id_ct_KP_encryptedKeyPkg = univ.ObjectIdentifier('2.16.840.1.101.2.1.2.78.2')38 39class EncryptedKeyPackage(univ.Choice):40    pass41 42EncryptedKeyPackage.componentType = namedtype.NamedTypes(43    namedtype.NamedType('encrypted', rfc5652.EncryptedData()),44    namedtype.NamedType('enveloped', rfc5652.EnvelopedData().subtype(45        implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),46    namedtype.NamedType('authEnveloped', rfc5083.AuthEnvelopedData().subtype(47        implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)))48)49 50 51# Map of Attribute Type OIDs to Attributes are52# added to the ones that are in rfc5652.py53 54_cmsAttributesMapUpdate = {55    id_aa_KP_contentDecryptKeyID: ContentDecryptKeyID(),56}57 58rfc5652.cmsAttributesMap.update(_cmsAttributesMapUpdate)59 60 61# Map of Content Type OIDs to Content Types are62# added to the ones that are in rfc5652.py63 64_cmsContentTypesMapUpdate = {65    id_ct_KP_encryptedKeyPkg: EncryptedKeyPackage(),66}67 68rfc5652.cmsContentTypesMap.update(_cmsContentTypesMapUpdate)69 
codekingpro/portable-devtools · Team Ai