Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
rfc3274.py60 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# 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# CMS Compressed Data Content Type11#12# ASN.1 source from:13# https://www.rfc-editor.org/rfc/rfc3274.txt14#15 16from pyasn1.type import namedtype17from pyasn1.type import univ18 19from pyasn1_modules import rfc528020from pyasn1_modules import rfc565221 22 23class CompressionAlgorithmIdentifier(rfc5280.AlgorithmIdentifier):24    pass25 26 27# The CMS Compressed Data Content Type28 29id_ct_compressedData = univ.ObjectIdentifier('1.2.840.113549.1.9.16.1.9')30 31class CompressedData(univ.Sequence):32    pass33 34CompressedData.componentType = namedtype.NamedTypes(35    namedtype.NamedType('version', rfc5652.CMSVersion()), # Always set to 036    namedtype.NamedType('compressionAlgorithm', CompressionAlgorithmIdentifier()),37    namedtype.NamedType('encapContentInfo', rfc5652.EncapsulatedContentInfo())38)39 40 41# Algorithm identifier for the zLib Compression Algorithm42# This includes cpa_zlibCompress as defined in RFC 6268,43# from https://www.rfc-editor.org/rfc/rfc6268.txt44 45id_alg_zlibCompress = univ.ObjectIdentifier('1.2.840.113549.1.9.16.3.8')46 47cpa_zlibCompress = rfc5280.AlgorithmIdentifier()48cpa_zlibCompress['algorithm'] = id_alg_zlibCompress49# cpa_zlibCompress['parameters'] are absent50 51 52# Map of Content Type OIDs to Content Types is added to thr53# ones that are in rfc5652.py54 55_cmsContentTypesMapUpdate = {56    id_ct_compressedData: CompressedData(),57}58 59rfc5652.cmsContentTypesMap.update(_cmsContentTypesMapUpdate)60 
codekingpro/portable-devtools · Team Ai