Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
rfc6486.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# RPKI Manifests10#11# ASN.1 source from:12# https://www.rfc-editor.org/rfc/rfc6486.txt13#14 15from pyasn1.type import char16from pyasn1.type import constraint17from pyasn1.type import namedtype18from pyasn1.type import tag19from pyasn1.type import useful20from pyasn1.type import univ21 22from pyasn1_modules import rfc565223 24MAX = float('inf')25 26 27id_smime = univ.ObjectIdentifier('1.2.840.113549.1.9.16')28 29id_ct = id_smime + (1, )30 31id_ct_rpkiManifest = id_ct + (26, )32 33 34class FileAndHash(univ.Sequence):35    componentType = namedtype.NamedTypes(36        namedtype.NamedType('file', char.IA5String()),37        namedtype.NamedType('hash', univ.BitString())38    )39 40 41class Manifest(univ.Sequence):42    componentType = namedtype.NamedTypes(43        namedtype.DefaultedNamedType('version',44            univ.Integer().subtype(explicitTag=tag.Tag(45                tag.tagClassContext, tag.tagFormatSimple, 0)).subtype(value=0)),46        namedtype.NamedType('manifestNumber',47            univ.Integer().subtype(48                subtypeSpec=constraint.ValueRangeConstraint(0, MAX))),49        namedtype.NamedType('thisUpdate',50            useful.GeneralizedTime()),51        namedtype.NamedType('nextUpdate',52            useful.GeneralizedTime()),53        namedtype.NamedType('fileHashAlg',54            univ.ObjectIdentifier()),55        namedtype.NamedType('fileList',56            univ.SequenceOf(componentType=FileAndHash()).subtype(57                subtypeSpec=constraint.ValueSizeConstraint(0, MAX)))58    )59 60 61# Map of Content Type OIDs to Content Types added to the62# ones that are in rfc5652.py63 64_cmsContentTypesMapUpdate = {65    id_ct_rpkiManifest: Manifest(),66}67 68rfc5652.cmsContentTypesMap.update(_cmsContentTypesMapUpdate)69 
codekingpro/portable-devtools · Team Ai