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, LLC 8# License: http://snmplabs.com/pyasn1/license.html 9# 10# CMS Compressed Data Content Type 11# 12# ASN.1 source from: 13# https://www.rfc-editor.org/rfc/rfc3274.txt 14# 15 16from pyasn1.type import namedtype 17from pyasn1.type import univ 18 19from pyasn1_modules import rfc5280 20from pyasn1_modules import rfc5652 21 22 23class CompressionAlgorithmIdentifier(rfc5280.AlgorithmIdentifier): 24 pass 25 26 27# The CMS Compressed Data Content Type 28 29id_ct_compressedData = univ.ObjectIdentifier('1.2.840.113549.1.9.16.1.9') 30 31class CompressedData(univ.Sequence): 32 pass 33 34CompressedData.componentType = namedtype.NamedTypes( 35 namedtype.NamedType('version', rfc5652.CMSVersion()), # Always set to 0 36 namedtype.NamedType('compressionAlgorithm', CompressionAlgorithmIdentifier()), 37 namedtype.NamedType('encapContentInfo', rfc5652.EncapsulatedContentInfo()) 38) 39 40 41# Algorithm identifier for the zLib Compression Algorithm 42# This includes cpa_zlibCompress as defined in RFC 6268, 43# from https://www.rfc-editor.org/rfc/rfc6268.txt 44 45id_alg_zlibCompress = univ.ObjectIdentifier('1.2.840.113549.1.9.16.3.8') 46 47cpa_zlibCompress = rfc5280.AlgorithmIdentifier() 48cpa_zlibCompress['algorithm'] = id_alg_zlibCompress 49# cpa_zlibCompress['parameters'] are absent 50 51 52# Map of Content Type OIDs to Content Types is added to thr 53# ones that are in rfc5652.py 54 55_cmsContentTypesMapUpdate = { 56 id_ct_compressedData: CompressedData(), 57} 58 59rfc5652.cmsContentTypesMap.update(_cmsContentTypesMapUpdate) 60