Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
rfc4073.py60 linesDownload Raw Back to pyasn1_modules
1#2# This file is part of pyasn1-modules software.3#4# Created by Russ Housley with some assistance from asn1ate v.0.6.0.5# Modified by Russ Housley to add a map for use with opentypes.6#7# Copyright (c) 2019, Vigil Security, LLC8# License: http://snmplabs.com/pyasn1/license.html9#10# Protecting Multiple Contents with the CMS11#12# ASN.1 source from:13# https://www.rfc-editor.org/rfc/rfc4073.txt14#15 16from pyasn1.type import constraint17from pyasn1.type import namedtype18from pyasn1.type import univ19 20from pyasn1_modules import rfc565221 22MAX = float('inf')23 24 25# Content Collection Content Type and Object Identifier26 27id_ct_contentCollection = univ.ObjectIdentifier('1.2.840.113549.1.9.16.1.19')28 29class ContentCollection(univ.SequenceOf):30    pass31 32ContentCollection.componentType = rfc5652.ContentInfo()33ContentCollection.sizeSpec = constraint.ValueSizeConstraint(1, MAX)34 35 36# Content With Attributes Content Type and Object Identifier37 38id_ct_contentWithAttrs = univ.ObjectIdentifier('1.2.840.113549.1.9.16.1.20')39 40class ContentWithAttributes(univ.Sequence):41    pass42 43ContentWithAttributes.componentType = namedtype.NamedTypes(44    namedtype.NamedType('content', rfc5652.ContentInfo()),45    namedtype.NamedType('attrs', univ.SequenceOf(46        componentType=rfc5652.Attribute()).subtype(47            sizeSpec=constraint.ValueSizeConstraint(1, MAX)))48)49 50 51# Map of Content Type OIDs to Content Types is added to the52# ones that are in rfc5652.py53 54_cmsContentTypesMapUpdate = {55    id_ct_contentCollection: ContentCollection(),56    id_ct_contentWithAttrs: ContentWithAttributes(),57}58 59rfc5652.cmsContentTypesMap.update(_cmsContentTypesMapUpdate)60 
codekingpro/portable-devtools · Team Ai