codekingpro/portable-devtools
114k
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 map for use with opentypes.6#7# Copyright (c) 2019, Vigil Security, LLC8# License: http://snmplabs.com/pyasn1/license.html9#10# Additional CMS Revocation Information Choices11#12# ASN.1 source from:13# https://www.rfc-editor.org/rfc/rfc5940.txt14#15 16from pyasn1.type import namedtype17from pyasn1.type import tag18from pyasn1.type import univ19 20from pyasn1_modules import rfc256021from pyasn1_modules import rfc565222 23 24# RevocationInfoChoice for OCSP response:25# The OID is included in otherRevInfoFormat, and26# signed OCSPResponse is included in otherRevInfo27 28id_ri_ocsp_response = univ.ObjectIdentifier('1.3.6.1.5.5.7.16.2')29 30OCSPResponse = rfc2560.OCSPResponse31 32 33# RevocationInfoChoice for SCVP request/response:34# The OID is included in otherRevInfoFormat, and35# SCVPReqRes is included in otherRevInfo36 37id_ri_scvp = univ.ObjectIdentifier('1.3.6.1.5.5.7.16.4')38 39ContentInfo = rfc5652.ContentInfo40 41class SCVPReqRes(univ.Sequence):42 pass43 44SCVPReqRes.componentType = namedtype.NamedTypes(45 namedtype.OptionalNamedType('request',46 ContentInfo().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),47 namedtype.NamedType('response', ContentInfo())48)49 50 51# Map of Revocation Info Format OIDs to Revocation Info Format52# is added to the ones that are in rfc5652.py53 54_otherRevInfoFormatMapUpdate = {55 id_ri_ocsp_response: OCSPResponse(),56 id_ri_scvp: SCVPReqRes(),57}58 59rfc5652.otherRevInfoFormatMap.update(_otherRevInfoFormatMapUpdate)60 