| 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, LLC |
| 8 |
# License: http://snmplabs.com/pyasn1/license.html |
| 9 |
# |
| 10 |
# Additional CMS Revocation Information Choices |
| 11 |
# |
| 12 |
# ASN.1 source from: |
| 13 |
# https://www.rfc-editor.org/rfc/rfc5940.txt |
| 14 |
# |
| 15 |
|
| 16 |
from pyasn1.type import namedtype |
| 17 |
from pyasn1.type import tag |
| 18 |
from pyasn1.type import univ |
| 19 |
|
| 20 |
from pyasn1_modules import rfc2560 |
| 21 |
from pyasn1_modules import rfc5652 |
| 22 |
|
| 23 |
|
| 24 |
# RevocationInfoChoice for OCSP response: |
| 25 |
# The OID is included in otherRevInfoFormat, and |
| 26 |
# signed OCSPResponse is included in otherRevInfo |
| 27 |
|
| 28 |
id_ri_ocsp_response = univ.ObjectIdentifier('1.3.6.1.5.5.7.16.2') |
| 29 |
|
| 30 |
OCSPResponse = rfc2560.OCSPResponse |
| 31 |
|
| 32 |
|
| 33 |
# RevocationInfoChoice for SCVP request/response: |
| 34 |
# The OID is included in otherRevInfoFormat, and |
| 35 |
# SCVPReqRes is included in otherRevInfo |
| 36 |
|
| 37 |
id_ri_scvp = univ.ObjectIdentifier('1.3.6.1.5.5.7.16.4') |
| 38 |
|
| 39 |
ContentInfo = rfc5652.ContentInfo |
| 40 |
|
| 41 |
class SCVPReqRes(univ.Sequence): |
| 42 |
pass |
| 43 |
|
| 44 |
SCVPReqRes.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 Format |
| 52 |
# is added to the ones that are in rfc5652.py |
| 53 |
|
| 54 |
_otherRevInfoFormatMapUpdate = { |
| 55 |
id_ri_ocsp_response: OCSPResponse(), |
| 56 |
id_ri_scvp: SCVPReqRes(), |
| 57 |
} |
| 58 |
|
| 59 |
rfc5652.otherRevInfoFormatMap.update(_otherRevInfoFormatMapUpdate) |