pyasn1-alt-modules 0.4.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pyasn1-alt-modules might be problematic. Click here for more details.
- pyasn1_alt_modules/__init__.py +2 -0
- pyasn1_alt_modules/opentypemap.py +19 -0
- pyasn1_alt_modules/pem.py +66 -0
- pyasn1_alt_modules/rfc1155.py +97 -0
- pyasn1_alt_modules/rfc1157.py +127 -0
- pyasn1_alt_modules/rfc1901.py +23 -0
- pyasn1_alt_modules/rfc1902.py +130 -0
- pyasn1_alt_modules/rfc1905.py +136 -0
- pyasn1_alt_modules/rfc2040.py +50 -0
- pyasn1_alt_modules/rfc2251.py +564 -0
- pyasn1_alt_modules/rfc2314.py +68 -0
- pyasn1_alt_modules/rfc2315.py +325 -0
- pyasn1_alt_modules/rfc2437.py +70 -0
- pyasn1_alt_modules/rfc2459.py +1340 -0
- pyasn1_alt_modules/rfc2511.py +303 -0
- pyasn1_alt_modules/rfc2528.py +34 -0
- pyasn1_alt_modules/rfc2560.py +226 -0
- pyasn1_alt_modules/rfc2631.py +37 -0
- pyasn1_alt_modules/rfc2634.py +342 -0
- pyasn1_alt_modules/rfc2743.py +60 -0
- pyasn1_alt_modules/rfc2876.py +61 -0
- pyasn1_alt_modules/rfc2898.py +72 -0
- pyasn1_alt_modules/rfc2985.py +593 -0
- pyasn1_alt_modules/rfc2986.py +76 -0
- pyasn1_alt_modules/rfc3058.py +48 -0
- pyasn1_alt_modules/rfc3114.py +80 -0
- pyasn1_alt_modules/rfc3125.py +469 -0
- pyasn1_alt_modules/rfc3161.py +142 -0
- pyasn1_alt_modules/rfc3217.py +42 -0
- pyasn1_alt_modules/rfc3274.py +62 -0
- pyasn1_alt_modules/rfc3279.py +264 -0
- pyasn1_alt_modules/rfc3280.py +1544 -0
- pyasn1_alt_modules/rfc3281.py +332 -0
- pyasn1_alt_modules/rfc3370.py +142 -0
- pyasn1_alt_modules/rfc3412.py +54 -0
- pyasn1_alt_modules/rfc3414.py +29 -0
- pyasn1_alt_modules/rfc3447.py +46 -0
- pyasn1_alt_modules/rfc3537.py +44 -0
- pyasn1_alt_modules/rfc3546.py +23 -0
- pyasn1_alt_modules/rfc3560.py +74 -0
- pyasn1_alt_modules/rfc3565.py +59 -0
- pyasn1_alt_modules/rfc3657.py +69 -0
- pyasn1_alt_modules/rfc3709.py +230 -0
- pyasn1_alt_modules/rfc3739.py +207 -0
- pyasn1_alt_modules/rfc3770.py +77 -0
- pyasn1_alt_modules/rfc3779.py +139 -0
- pyasn1_alt_modules/rfc3820.py +66 -0
- pyasn1_alt_modules/rfc3852.py +707 -0
- pyasn1_alt_modules/rfc3874.py +29 -0
- pyasn1_alt_modules/rfc4010.py +58 -0
- pyasn1_alt_modules/rfc4043.py +45 -0
- pyasn1_alt_modules/rfc4055.py +285 -0
- pyasn1_alt_modules/rfc4056.py +56 -0
- pyasn1_alt_modules/rfc4059.py +101 -0
- pyasn1_alt_modules/rfc4073.py +62 -0
- pyasn1_alt_modules/rfc4108.py +355 -0
- pyasn1_alt_modules/rfc4210.py +807 -0
- pyasn1_alt_modules/rfc4211.py +420 -0
- pyasn1_alt_modules/rfc4231.py +38 -0
- pyasn1_alt_modules/rfc4262.py +37 -0
- pyasn1_alt_modules/rfc4334.py +78 -0
- pyasn1_alt_modules/rfc4357.py +485 -0
- pyasn1_alt_modules/rfc4366.py +23 -0
- pyasn1_alt_modules/rfc4387.py +23 -0
- pyasn1_alt_modules/rfc4476.py +99 -0
- pyasn1_alt_modules/rfc4490.py +119 -0
- pyasn1_alt_modules/rfc4491.py +44 -0
- pyasn1_alt_modules/rfc4683.py +76 -0
- pyasn1_alt_modules/rfc4985.py +52 -0
- pyasn1_alt_modules/rfc4998.py +125 -0
- pyasn1_alt_modules/rfc5035.py +206 -0
- pyasn1_alt_modules/rfc5055.py +763 -0
- pyasn1_alt_modules/rfc5083.py +55 -0
- pyasn1_alt_modules/rfc5084.py +94 -0
- pyasn1_alt_modules/rfc5126.py +578 -0
- pyasn1_alt_modules/rfc5208.py +73 -0
- pyasn1_alt_modules/rfc5275.py +404 -0
- pyasn1_alt_modules/rfc5276.py +82 -0
- pyasn1_alt_modules/rfc5280.py +1666 -0
- pyasn1_alt_modules/rfc5480.py +190 -0
- pyasn1_alt_modules/rfc5544.py +127 -0
- pyasn1_alt_modules/rfc5636.py +117 -0
- pyasn1_alt_modules/rfc5639.py +49 -0
- pyasn1_alt_modules/rfc5649.py +33 -0
- pyasn1_alt_modules/rfc5652.py +763 -0
- pyasn1_alt_modules/rfc5697.py +64 -0
- pyasn1_alt_modules/rfc5698.py +159 -0
- pyasn1_alt_modules/rfc5751.py +127 -0
- pyasn1_alt_modules/rfc5752.py +52 -0
- pyasn1_alt_modules/rfc5753.py +163 -0
- pyasn1_alt_modules/rfc5755.py +400 -0
- pyasn1_alt_modules/rfc5913.py +46 -0
- pyasn1_alt_modules/rfc5914.py +119 -0
- pyasn1_alt_modules/rfc5915.py +32 -0
- pyasn1_alt_modules/rfc5916.py +39 -0
- pyasn1_alt_modules/rfc5917.py +59 -0
- pyasn1_alt_modules/rfc5924.py +19 -0
- pyasn1_alt_modules/rfc5934.py +786 -0
- pyasn1_alt_modules/rfc5940.py +62 -0
- pyasn1_alt_modules/rfc5958.py +100 -0
- pyasn1_alt_modules/rfc5990.py +238 -0
- pyasn1_alt_modules/rfc6010.py +92 -0
- pyasn1_alt_modules/rfc6019.py +46 -0
- pyasn1_alt_modules/rfc6031.py +469 -0
- pyasn1_alt_modules/rfc6032.py +71 -0
- pyasn1_alt_modules/rfc6066.py +25 -0
- pyasn1_alt_modules/rfc6120.py +46 -0
- pyasn1_alt_modules/rfc6170.py +17 -0
- pyasn1_alt_modules/rfc6187.py +22 -0
- pyasn1_alt_modules/rfc6210.py +45 -0
- pyasn1_alt_modules/rfc6211.py +75 -0
- pyasn1_alt_modules/rfc6402.py +643 -0
- pyasn1_alt_modules/rfc6482.py +77 -0
- pyasn1_alt_modules/rfc6484.py +17 -0
- pyasn1_alt_modules/rfc6486.py +70 -0
- pyasn1_alt_modules/rfc6487.py +22 -0
- pyasn1_alt_modules/rfc6492.py +41 -0
- pyasn1_alt_modules/rfc6493.py +24 -0
- pyasn1_alt_modules/rfc6494.py +23 -0
- pyasn1_alt_modules/rfc6664.py +151 -0
- pyasn1_alt_modules/rfc6955.py +112 -0
- pyasn1_alt_modules/rfc6960.py +234 -0
- pyasn1_alt_modules/rfc6962.py +52 -0
- pyasn1_alt_modules/rfc7030.py +70 -0
- pyasn1_alt_modules/rfc7191.py +267 -0
- pyasn1_alt_modules/rfc7229.py +29 -0
- pyasn1_alt_modules/rfc7292.py +359 -0
- pyasn1_alt_modules/rfc7296.py +32 -0
- pyasn1_alt_modules/rfc7508.py +92 -0
- pyasn1_alt_modules/rfc7585.py +53 -0
- pyasn1_alt_modules/rfc7633.py +40 -0
- pyasn1_alt_modules/rfc7693.py +66 -0
- pyasn1_alt_modules/rfc7773.py +54 -0
- pyasn1_alt_modules/rfc7836.py +65 -0
- pyasn1_alt_modules/rfc7894.py +100 -0
- pyasn1_alt_modules/rfc7906.py +739 -0
- pyasn1_alt_modules/rfc7914.py +55 -0
- pyasn1_alt_modules/rfc8017.py +159 -0
- pyasn1_alt_modules/rfc8018.py +269 -0
- pyasn1_alt_modules/rfc8103.py +36 -0
- pyasn1_alt_modules/rfc8209.py +20 -0
- pyasn1_alt_modules/rfc8226.py +151 -0
- pyasn1_alt_modules/rfc8358.py +54 -0
- pyasn1_alt_modules/rfc8360.py +46 -0
- pyasn1_alt_modules/rfc8398.py +55 -0
- pyasn1_alt_modules/rfc8410.py +43 -0
- pyasn1_alt_modules/rfc8418.py +36 -0
- pyasn1_alt_modules/rfc8419.py +70 -0
- pyasn1_alt_modules/rfc8479.py +48 -0
- pyasn1_alt_modules/rfc8494.py +80 -0
- pyasn1_alt_modules/rfc8520.py +66 -0
- pyasn1_alt_modules/rfc8619.py +45 -0
- pyasn1_alt_modules/rfc8649.py +42 -0
- pyasn1_alt_modules/rfc8692.py +79 -0
- pyasn1_alt_modules/rfc8696.py +108 -0
- pyasn1_alt_modules/rfc8702.py +109 -0
- pyasn1_alt_modules/rfc8708.py +43 -0
- pyasn1_alt_modules/rfc8737.py +36 -0
- pyasn1_alt_modules/rfc8769.py +21 -0
- pyasn1_alt_modules/rfc8894.py +52 -0
- pyasn1_alt_modules/rfc8951.py +42 -0
- pyasn1_alt_modules/rfc8954.py +238 -0
- pyasn1_alt_modules/rfc8994.py +52 -0
- pyasn1_alt_modules/rfc8995.py +39 -0
- pyasn1_alt_modules/rfc9044.py +80 -0
- pyasn1_alt_modules/rfc9092.py +35 -0
- pyasn1_alt_modules/rfc9118.py +82 -0
- pyasn1_alt_modules/rfc9174.py +55 -0
- pyasn1_alt_modules/rfc9189.py +74 -0
- pyasn1_alt_modules/rfc9215.py +228 -0
- pyasn1_alt_modules/rfc9286.py +78 -0
- pyasn1_alt_modules/rfc9289.py +22 -0
- pyasn1_alt_modules/rfc9310.py +46 -0
- pyasn1_alt_modules/rfc9323.py +129 -0
- pyasn1_alt_modules/rfc9336.py +20 -0
- pyasn1_alt_modules/rfc9337.py +74 -0
- pyasn1_alt_modules/rfc9345.py +36 -0
- pyasn1_alt_modules/rfc9385.py +22 -0
- pyasn1_alt_modules/rfc9399.py +59 -0
- pyasn1_alt_modules/rfc9480.py +731 -0
- pyasn1_alt_modules/rfc9481.py +224 -0
- pyasn1_alt_modules/rfc9509.py +24 -0
- pyasn1_alt_modules/rfc9548.py +23 -0
- pyasn1_alt_modules/rfc9579.py +89 -0
- pyasn1_alt_modules/rfc9582.py +107 -0
- pyasn1_alt_modules/rfc9598.py +52 -0
- pyasn1_alt_modules/rfc9608.py +35 -0
- pyasn1_alt_modules/rfc9629.py +100 -0
- pyasn1_alt_modules/rfc9654.py +241 -0
- pyasn1_alt_modules-0.4.5.dist-info/LICENSE.txt +25 -0
- pyasn1_alt_modules-0.4.5.dist-info/METADATA +34 -0
- pyasn1_alt_modules-0.4.5.dist-info/RECORD +195 -0
- pyasn1_alt_modules-0.4.5.dist-info/WHEEL +5 -0
- pyasn1_alt_modules-0.4.5.dist-info/top_level.txt +1 -0
- pyasn1_alt_modules-0.4.5.dist-info/zip-safe +1 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file is part of pyasn1-alt-modules software.
|
|
3
|
+
#
|
|
4
|
+
# Created by Russ Housley with assistance from asn1ate v.0.6.0.
|
|
5
|
+
# Modified by Russ Housley to include the opentypemap manager.
|
|
6
|
+
#
|
|
7
|
+
# Copyright (c) 2019-2024, Vigil Security, LLC
|
|
8
|
+
# License: http://vigilsec.com/pyasn1-alt-modules-license.txt
|
|
9
|
+
#
|
|
10
|
+
# Using the GOST 28147-89, GOST R 34.11-94, GOST R 34.10-94, and
|
|
11
|
+
# GOST R 34.10-2001 Algorithms with the CMS
|
|
12
|
+
#
|
|
13
|
+
# ASN.1 source from:
|
|
14
|
+
# https://www.rfc-editor.org/rfc/rfc4490.txt
|
|
15
|
+
#
|
|
16
|
+
|
|
17
|
+
from pyasn1.type import constraint
|
|
18
|
+
from pyasn1.type import namedtype
|
|
19
|
+
from pyasn1.type import tag
|
|
20
|
+
from pyasn1.type import univ
|
|
21
|
+
|
|
22
|
+
from pyasn1_alt_modules import rfc4357
|
|
23
|
+
from pyasn1_alt_modules import rfc5280
|
|
24
|
+
from pyasn1_alt_modules import opentypemap
|
|
25
|
+
|
|
26
|
+
algorithmIdentifierMap = opentypemap.get('algorithmIdentifierMap')
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
# Imports from RFC 4357
|
|
30
|
+
|
|
31
|
+
id_CryptoPro_algorithms = rfc4357.id_CryptoPro_algorithms
|
|
32
|
+
|
|
33
|
+
id_GostR3410_94 = rfc4357.id_GostR3410_94
|
|
34
|
+
|
|
35
|
+
id_GostR3410_2001 = rfc4357.id_GostR3410_2001
|
|
36
|
+
|
|
37
|
+
Gost28147_89_ParamSet = rfc4357.Gost28147_89_ParamSet
|
|
38
|
+
|
|
39
|
+
Gost28147_89_EncryptedKey = rfc4357.Gost28147_89_EncryptedKey
|
|
40
|
+
|
|
41
|
+
GostR3410_94_PublicKeyParameters = rfc4357.GostR3410_94_PublicKeyParameters
|
|
42
|
+
|
|
43
|
+
GostR3410_2001_PublicKeyParameters = rfc4357.GostR3410_2001_PublicKeyParameters
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
# Imports from RFC 5280
|
|
47
|
+
|
|
48
|
+
SubjectPublicKeyInfo = rfc5280.SubjectPublicKeyInfo
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
# CMS/PKCS#7 key agreement algorithms & parameters
|
|
52
|
+
|
|
53
|
+
class Gost28147_89_KeyWrapParameters(univ.Sequence):
|
|
54
|
+
componentType = namedtype.NamedTypes(
|
|
55
|
+
namedtype.NamedType('encryptionParamSet', Gost28147_89_ParamSet()),
|
|
56
|
+
namedtype.OptionalNamedType('ukm', univ.OctetString().subtype(
|
|
57
|
+
subtypeSpec=constraint.ValueSizeConstraint(8, 8)))
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
id_Gost28147_89_CryptoPro_KeyWrap = id_CryptoPro_algorithms + (13, 1, )
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
id_Gost28147_89_None_KeyWrap = id_CryptoPro_algorithms + (13, 0, )
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
id_GostR3410_2001_CryptoPro_ESDH = id_CryptoPro_algorithms + (96, )
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
id_GostR3410_94_CryptoPro_ESDH = id_CryptoPro_algorithms + (97, )
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
# CMS/PKCS#7 key transport algorithms & parameters
|
|
74
|
+
|
|
75
|
+
id_GostR3410_2001_KeyTransportSMIMECapability = id_GostR3410_2001
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
id_GostR3410_94_KeyTransportSMIMECapability = id_GostR3410_94
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class GostR3410_TransportParameters(univ.Sequence):
|
|
82
|
+
componentType = namedtype.NamedTypes(
|
|
83
|
+
namedtype.NamedType('encryptionParamSet', Gost28147_89_ParamSet()),
|
|
84
|
+
namedtype.OptionalNamedType('ephemeralPublicKey',
|
|
85
|
+
SubjectPublicKeyInfo().subtype(implicitTag=tag.Tag(
|
|
86
|
+
tag.tagClassContext, tag.tagFormatSimple, 0))),
|
|
87
|
+
namedtype.NamedType('ukm', univ.OctetString().subtype(
|
|
88
|
+
subtypeSpec=constraint.ValueSizeConstraint(8, 8)))
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
class GostR3410_KeyTransport(univ.Sequence):
|
|
92
|
+
componentType = namedtype.NamedTypes(
|
|
93
|
+
namedtype.NamedType('sessionEncryptedKey', Gost28147_89_EncryptedKey()),
|
|
94
|
+
namedtype.OptionalNamedType('transportParameters',
|
|
95
|
+
GostR3410_TransportParameters().subtype(implicitTag=tag.Tag(
|
|
96
|
+
tag.tagClassContext, tag.tagFormatConstructed, 0)))
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
# GOST R 34.10-94 signature algorithm & parameters
|
|
101
|
+
|
|
102
|
+
class GostR3410_94_Signature(univ.OctetString):
|
|
103
|
+
subtypeSpec = constraint.ValueSizeConstraint(64, 64)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
# GOST R 34.10-2001 signature algorithms and parameters
|
|
107
|
+
|
|
108
|
+
class GostR3410_2001_Signature(univ.OctetString):
|
|
109
|
+
subtypeSpec = constraint.ValueSizeConstraint(64, 64)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
# Update the Algorithm Identifier Map and the S/MIME Capability Map
|
|
113
|
+
|
|
114
|
+
_algorithmIdentifierMapUpdate = {
|
|
115
|
+
id_Gost28147_89_CryptoPro_KeyWrap: Gost28147_89_KeyWrapParameters(),
|
|
116
|
+
id_Gost28147_89_None_KeyWrap: Gost28147_89_KeyWrapParameters(),
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
algorithmIdentifierMap.update(_algorithmIdentifierMapUpdate)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file is part of pyasn1-alt-modules software.
|
|
3
|
+
#
|
|
4
|
+
# Created by Russ Housley.
|
|
5
|
+
#
|
|
6
|
+
# Copyright (c) 2019-2024, Vigil Security, LLC
|
|
7
|
+
# License: http://vigilsec.com/pyasn1-alt-modules-license.txt
|
|
8
|
+
#
|
|
9
|
+
# Using the GOST R 34.10-94, GOST R 34.10-2001, and GOST R 34.11-94
|
|
10
|
+
# Algorithms with Certificates and CRLs
|
|
11
|
+
#
|
|
12
|
+
# ASN.1 source from:
|
|
13
|
+
# https://www.rfc-editor.org/rfc/rfc4491.txt
|
|
14
|
+
#
|
|
15
|
+
|
|
16
|
+
from pyasn1_alt_modules import rfc4357
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# Signature Algorithm GOST R 34.10-94
|
|
20
|
+
|
|
21
|
+
id_GostR3411_94_with_GostR3410_94 = rfc4357.id_GostR3411_94_with_GostR3410_94
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# Signature Algorithm GOST R 34.10-2001
|
|
25
|
+
|
|
26
|
+
id_GostR3411_94_with_GostR3410_2001 = rfc4357.id_GostR3411_94_with_GostR3410_2001
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
# GOST R 34.10-94 Keys
|
|
30
|
+
|
|
31
|
+
id_GostR3410_94 = rfc4357.id_GostR3410_94
|
|
32
|
+
|
|
33
|
+
GostR3410_2001_PublicKey = rfc4357.GostR3410_2001_PublicKey
|
|
34
|
+
|
|
35
|
+
GostR3410_2001_PublicKeyParameters = rfc4357.GostR3410_2001_PublicKeyParameters
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
# GOST R 34.10-2001 Keys
|
|
39
|
+
|
|
40
|
+
id_GostR3410_2001 = rfc4357.id_GostR3410_2001
|
|
41
|
+
|
|
42
|
+
GostR3410_94_PublicKey = rfc4357.GostR3410_94_PublicKey
|
|
43
|
+
|
|
44
|
+
GostR3410_94_PublicKeyParameters = rfc4357.GostR3410_94_PublicKeyParameters
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file is part of pyasn1-alt-modules software.
|
|
3
|
+
#
|
|
4
|
+
# Created by Russ Housley with assistance from asn1ate v.0.6.0.
|
|
5
|
+
# Modified by Russ Housley to include the opentypemap manager.
|
|
6
|
+
#
|
|
7
|
+
# Copyright (c) 2019-2024, Vigil Security, LLC
|
|
8
|
+
# License: http://vigilsec.com/pyasn1-alt-modules-license.txt
|
|
9
|
+
#
|
|
10
|
+
# Subject Identification Method (SIM)
|
|
11
|
+
#
|
|
12
|
+
# ASN.1 source from:
|
|
13
|
+
# https://www.rfc-editor.org/rfc/rfc4683.txt
|
|
14
|
+
# https://www.rfc-editor.org/errata/eid1047
|
|
15
|
+
#
|
|
16
|
+
|
|
17
|
+
from pyasn1.type import char
|
|
18
|
+
from pyasn1.type import namedtype
|
|
19
|
+
from pyasn1.type import univ
|
|
20
|
+
|
|
21
|
+
from pyasn1_alt_modules import rfc5280
|
|
22
|
+
from pyasn1_alt_modules import opentypemap
|
|
23
|
+
|
|
24
|
+
otherNamesMap = opentypemap.get('otherNamesMap')
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
# Used to compute the PEPSI value
|
|
28
|
+
|
|
29
|
+
class HashContent(univ.Sequence):
|
|
30
|
+
componentType = namedtype.NamedTypes(
|
|
31
|
+
namedtype.NamedType('userPassword', char.UTF8String()),
|
|
32
|
+
namedtype.NamedType('authorityRandom', univ.OctetString()),
|
|
33
|
+
namedtype.NamedType('identifierType', univ.ObjectIdentifier()),
|
|
34
|
+
namedtype.NamedType('identifier', char.UTF8String())
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
# Used to encode the PEPSI value as the SIM Other Name
|
|
39
|
+
|
|
40
|
+
id_pkix = rfc5280.id_pkix
|
|
41
|
+
|
|
42
|
+
id_on = id_pkix + (8,)
|
|
43
|
+
|
|
44
|
+
id_on_SIM = id_on + (6,)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class SIM(univ.Sequence):
|
|
48
|
+
componentType = namedtype.NamedTypes(
|
|
49
|
+
namedtype.NamedType('hashAlg', rfc5280.AlgorithmIdentifier()),
|
|
50
|
+
namedtype.NamedType('authorityRandom', univ.OctetString()),
|
|
51
|
+
namedtype.NamedType('pEPSI', univ.OctetString())
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
# Used to encrypt the PEPSI value during certificate request
|
|
56
|
+
|
|
57
|
+
id_pkip = id_pkix + (5,)
|
|
58
|
+
|
|
59
|
+
id_regEPEPSI = id_pkip + (3,)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class EncryptedPEPSI(univ.Sequence):
|
|
63
|
+
componentType = namedtype.NamedTypes(
|
|
64
|
+
namedtype.NamedType('identifierType', univ.ObjectIdentifier()),
|
|
65
|
+
namedtype.NamedType('identifier', char.UTF8String()),
|
|
66
|
+
namedtype.NamedType('sIM', SIM())
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
# Update the Other Names Map
|
|
71
|
+
|
|
72
|
+
_otherNamesMapUpdate = {
|
|
73
|
+
id_on_SIM: SIM(),
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
otherNamesMap.update(_otherNamesMapUpdate)
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file is part of pyasn1-alt-modules software.
|
|
3
|
+
#
|
|
4
|
+
# Created by Russ Housley.
|
|
5
|
+
# Modified by Russ Housley to include the opentypemap manager.
|
|
6
|
+
#
|
|
7
|
+
# Copyright (c) 2019-2024, Vigil Security, LLC
|
|
8
|
+
# License: http://vigilsec.com/pyasn1-alt-modules-license.txt
|
|
9
|
+
#
|
|
10
|
+
# Expression of Service Names in X.509 Certificates
|
|
11
|
+
#
|
|
12
|
+
# ASN.1 source from:
|
|
13
|
+
# https://www.rfc-editor.org/rfc/rfc4985.txt
|
|
14
|
+
#
|
|
15
|
+
|
|
16
|
+
from pyasn1.type import char
|
|
17
|
+
from pyasn1.type import constraint
|
|
18
|
+
from pyasn1.type import univ
|
|
19
|
+
|
|
20
|
+
from pyasn1_alt_modules import rfc5280
|
|
21
|
+
from pyasn1_alt_modules import opentypemap
|
|
22
|
+
|
|
23
|
+
otherNamesMap = opentypemap.get('otherNamesMap')
|
|
24
|
+
|
|
25
|
+
MAX = float('inf')
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# As specified in Appendix A.2 of RFC 4985
|
|
29
|
+
|
|
30
|
+
id_pkix = rfc5280.id_pkix
|
|
31
|
+
|
|
32
|
+
id_on = id_pkix + (8, )
|
|
33
|
+
|
|
34
|
+
id_on_dnsSRV = id_on + (7, )
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class SRVName(char.IA5String):
|
|
38
|
+
subtypeSpec = constraint.ValueSizeConstraint(1, MAX)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
srvName = rfc5280.AnotherName()
|
|
42
|
+
srvName['type-id'] = id_on_dnsSRV
|
|
43
|
+
srvName['value'] = SRVName()
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
# Update the Other Names Map
|
|
47
|
+
|
|
48
|
+
_otherNamesMapUpdate = {
|
|
49
|
+
id_on_dnsSRV: SRVName(),
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
otherNamesMap.update(_otherNamesMapUpdate)
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file is part of pyasn1-alt-modules software.
|
|
3
|
+
#
|
|
4
|
+
# Created by Russ Housley with some help from asn1ate v.0.6.0
|
|
5
|
+
# Modified by Russ Housley to include the opentypemap manager.
|
|
6
|
+
#
|
|
7
|
+
# Copyright (c) 2021-2024, Vigil Security, LLC
|
|
8
|
+
# License: http://vigilsec.com/pyasn1-alt-modules-license.txt
|
|
9
|
+
#
|
|
10
|
+
# Evidence Record Syntax (ERS)
|
|
11
|
+
#
|
|
12
|
+
# ASN.1 source from:
|
|
13
|
+
# https://www.rfc-editor.org/rfc/rfc4998.txt
|
|
14
|
+
#
|
|
15
|
+
|
|
16
|
+
from pyasn1.type import constraint
|
|
17
|
+
from pyasn1.type import namedtype
|
|
18
|
+
from pyasn1.type import namedval
|
|
19
|
+
from pyasn1.type import opentype
|
|
20
|
+
from pyasn1.type import tag
|
|
21
|
+
from pyasn1.type import univ
|
|
22
|
+
|
|
23
|
+
from pyasn1_alt_modules import rfc5280
|
|
24
|
+
from pyasn1_alt_modules import rfc5652
|
|
25
|
+
from pyasn1_alt_modules import opentypemap
|
|
26
|
+
|
|
27
|
+
cmsAttributesMap = opentypemap.get('cmsAttributesMap')
|
|
28
|
+
|
|
29
|
+
ersEncryptionInfoValuesMap = opentypemap.get('ersEncryptionInfoValuesMap')
|
|
30
|
+
|
|
31
|
+
MAX = float('inf')
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
# Imports from RFC 5280 and RFC 5652
|
|
35
|
+
|
|
36
|
+
AlgorithmIdentifier = rfc5280.AlgorithmIdentifier
|
|
37
|
+
|
|
38
|
+
Attribute = rfc5652.Attribute
|
|
39
|
+
|
|
40
|
+
ContentType = rfc5652.ContentType
|
|
41
|
+
|
|
42
|
+
ContentInfo = rfc5652.ContentInfo
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
# Evidence Record Syntax
|
|
46
|
+
|
|
47
|
+
class PartialHashtree(univ.SequenceOf):
|
|
48
|
+
componentType = univ.OctetString()
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class Attributes(univ.SetOf):
|
|
52
|
+
componentType = Attribute()
|
|
53
|
+
subtypeSpec = constraint.ValueSizeConstraint(1, MAX)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class ArchiveTimeStamp(univ.Sequence):
|
|
57
|
+
componentType = namedtype.NamedTypes(
|
|
58
|
+
namedtype.OptionalNamedType('digestAlgorithm',
|
|
59
|
+
AlgorithmIdentifier().subtype(implicitTag=tag.Tag(
|
|
60
|
+
tag.tagClassContext, tag.tagFormatConstructed, 0))),
|
|
61
|
+
namedtype.OptionalNamedType('attributes',
|
|
62
|
+
Attributes().subtype(implicitTag=tag.Tag(
|
|
63
|
+
tag.tagClassContext, tag.tagFormatSimple, 1))),
|
|
64
|
+
namedtype.OptionalNamedType('reducedHashtree',
|
|
65
|
+
univ.SequenceOf(componentType=PartialHashtree()).subtype(
|
|
66
|
+
implicitTag=tag.Tag(tag.tagClassContext,
|
|
67
|
+
tag.tagFormatSimple, 2))),
|
|
68
|
+
namedtype.NamedType('timeStamp', ContentInfo())
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class ArchiveTimeStampChain(univ.SequenceOf):
|
|
73
|
+
componentType = ArchiveTimeStamp()
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class ArchiveTimeStampSequence(univ.SequenceOf):
|
|
77
|
+
componentType = ArchiveTimeStampChain()
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
class CryptoInfos(univ.SequenceOf):
|
|
81
|
+
componentType = Attribute()
|
|
82
|
+
subtypeSpec = constraint.ValueSizeConstraint(1, MAX)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
class EncryptionInfo(univ.Sequence):
|
|
86
|
+
componentType = namedtype.NamedTypes(
|
|
87
|
+
namedtype.NamedType('encryptionInfoType', univ.ObjectIdentifier()),
|
|
88
|
+
namedtype.NamedType('encryptionInfoValue', univ.Any(),
|
|
89
|
+
openType=opentype.OpenType('encryptionInfoType',
|
|
90
|
+
ersEncryptionInfoValuesMap))
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
class EvidenceRecord(univ.Sequence):
|
|
95
|
+
componentType = namedtype.NamedTypes(
|
|
96
|
+
namedtype.NamedType('version',
|
|
97
|
+
univ.Integer(namedValues=namedval.NamedValues(('v1', 1)))),
|
|
98
|
+
namedtype.NamedType('digestAlgorithms',
|
|
99
|
+
univ.SequenceOf(componentType=AlgorithmIdentifier())),
|
|
100
|
+
namedtype.OptionalNamedType('cryptoInfos',
|
|
101
|
+
CryptoInfos().subtype(implicitTag=tag.Tag(
|
|
102
|
+
tag.tagClassContext, tag.tagFormatSimple, 0))),
|
|
103
|
+
namedtype.OptionalNamedType('encryptionInfo',
|
|
104
|
+
EncryptionInfo().subtype(implicitTag=tag.Tag(
|
|
105
|
+
tag.tagClassContext, tag.tagFormatConstructed, 1))),
|
|
106
|
+
namedtype.NamedType('archiveTimeStampSequence',
|
|
107
|
+
ArchiveTimeStampSequence())
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
ltans = univ.ObjectIdentifier('1.3.6.1.5.5.11')
|
|
112
|
+
|
|
113
|
+
id_aa_er_internal = univ.ObjectIdentifier('1.2.840.113549.1.9.16.2.49')
|
|
114
|
+
|
|
115
|
+
id_aa_er_internal = univ.ObjectIdentifier('1.2.840.113549.1.9.16.2.50')
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
# Update the CMS Attribute Map
|
|
119
|
+
|
|
120
|
+
_cmsAttributesMapUpdate = {
|
|
121
|
+
id_aa_er_internal: EvidenceRecord(),
|
|
122
|
+
id_aa_er_internal: EvidenceRecord(),
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
cmsAttributesMap.update(_cmsAttributesMapUpdate)
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file is part of pyasn1-alt-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
|
+
# Modified by Russ Housley to include the opentypemap manager.
|
|
7
|
+
#
|
|
8
|
+
# Copyright (c) 2019-2024, Vigil Security, LLC
|
|
9
|
+
# License: http://vigilsec.com/pyasn1-alt-modules-license.txt
|
|
10
|
+
#
|
|
11
|
+
# Update to Enhanced Security Services for S/MIME
|
|
12
|
+
#
|
|
13
|
+
# ASN.1 source from:
|
|
14
|
+
# https://www.rfc-editor.org/rfc/rfc5035.txt
|
|
15
|
+
#
|
|
16
|
+
|
|
17
|
+
from pyasn1.codec.der.encoder import encode as der_encode
|
|
18
|
+
|
|
19
|
+
from pyasn1.type import namedtype
|
|
20
|
+
from pyasn1.type import univ
|
|
21
|
+
|
|
22
|
+
from pyasn1_alt_modules import rfc2634
|
|
23
|
+
from pyasn1_alt_modules import rfc4055
|
|
24
|
+
from pyasn1_alt_modules import rfc5652
|
|
25
|
+
from pyasn1_alt_modules import rfc5280
|
|
26
|
+
from pyasn1_alt_modules import opentypemap
|
|
27
|
+
|
|
28
|
+
cmsAttributesMap = opentypemap.get('cmsAttributesMap')
|
|
29
|
+
|
|
30
|
+
cmsContentTypesMap = opentypemap.get('cmsContentTypesMap')
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# Imports from RFC 5280 and RFC 5652
|
|
34
|
+
|
|
35
|
+
ContentType = rfc5652.ContentType
|
|
36
|
+
|
|
37
|
+
IssuerAndSerialNumber = rfc5652.IssuerAndSerialNumber
|
|
38
|
+
|
|
39
|
+
SubjectKeyIdentifier = rfc5652.SubjectKeyIdentifier
|
|
40
|
+
|
|
41
|
+
AlgorithmIdentifier = rfc5280.AlgorithmIdentifier
|
|
42
|
+
|
|
43
|
+
PolicyInformation = rfc5280.PolicyInformation
|
|
44
|
+
|
|
45
|
+
GeneralNames = rfc5280.GeneralNames
|
|
46
|
+
|
|
47
|
+
CertificateSerialNumber = rfc5280.CertificateSerialNumber
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
# Signing Certificate Attribute V1 and V2
|
|
51
|
+
|
|
52
|
+
id_aa_signingCertificate = rfc2634.id_aa_signingCertificate
|
|
53
|
+
|
|
54
|
+
id_aa_signingCertificateV2 = univ.ObjectIdentifier('1.2.840.113549.1.9.16.2.47')
|
|
55
|
+
|
|
56
|
+
Hash = rfc2634.Hash
|
|
57
|
+
|
|
58
|
+
IssuerSerial = rfc2634.IssuerSerial
|
|
59
|
+
|
|
60
|
+
ESSCertID = rfc2634.ESSCertID
|
|
61
|
+
|
|
62
|
+
SigningCertificate = rfc2634.SigningCertificate
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
sha256AlgId = AlgorithmIdentifier()
|
|
66
|
+
sha256AlgId['algorithm'] = rfc4055.id_sha256
|
|
67
|
+
# A non-schema object for sha256AlgId['parameters'] as absent
|
|
68
|
+
sha256AlgId['parameters'] = der_encode(univ.OctetString(''))
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
class ESSCertIDv2(univ.Sequence):
|
|
72
|
+
pass
|
|
73
|
+
|
|
74
|
+
ESSCertIDv2.componentType = namedtype.NamedTypes(
|
|
75
|
+
namedtype.DefaultedNamedType('hashAlgorithm', sha256AlgId),
|
|
76
|
+
namedtype.NamedType('certHash', Hash()),
|
|
77
|
+
namedtype.OptionalNamedType('issuerSerial', IssuerSerial())
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class SigningCertificateV2(univ.Sequence):
|
|
82
|
+
pass
|
|
83
|
+
|
|
84
|
+
SigningCertificateV2.componentType = namedtype.NamedTypes(
|
|
85
|
+
namedtype.NamedType('certs', univ.SequenceOf(
|
|
86
|
+
componentType=ESSCertIDv2())),
|
|
87
|
+
namedtype.OptionalNamedType('policies', univ.SequenceOf(
|
|
88
|
+
componentType=PolicyInformation()))
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
# Mail List Expansion History Attribute
|
|
93
|
+
|
|
94
|
+
id_aa_mlExpandHistory = rfc2634.id_aa_mlExpandHistory
|
|
95
|
+
|
|
96
|
+
ub_ml_expansion_history = rfc2634.ub_ml_expansion_history
|
|
97
|
+
|
|
98
|
+
EntityIdentifier = rfc2634.EntityIdentifier
|
|
99
|
+
|
|
100
|
+
MLReceiptPolicy = rfc2634.MLReceiptPolicy
|
|
101
|
+
|
|
102
|
+
MLData = rfc2634.MLData
|
|
103
|
+
|
|
104
|
+
MLExpansionHistory = rfc2634.MLExpansionHistory
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
# ESS Security Label Attribute
|
|
108
|
+
|
|
109
|
+
id_aa_securityLabel = rfc2634.id_aa_securityLabel
|
|
110
|
+
|
|
111
|
+
ub_privacy_mark_length = rfc2634.ub_privacy_mark_length
|
|
112
|
+
|
|
113
|
+
ub_security_categories = rfc2634.ub_security_categories
|
|
114
|
+
|
|
115
|
+
ub_integer_options = rfc2634.ub_integer_options
|
|
116
|
+
|
|
117
|
+
ESSPrivacyMark = rfc2634.ESSPrivacyMark
|
|
118
|
+
|
|
119
|
+
SecurityClassification = rfc2634.SecurityClassification
|
|
120
|
+
|
|
121
|
+
SecurityPolicyIdentifier = rfc2634.SecurityPolicyIdentifier
|
|
122
|
+
|
|
123
|
+
SecurityCategory = rfc2634.SecurityCategory
|
|
124
|
+
|
|
125
|
+
SecurityCategories = rfc2634.SecurityCategories
|
|
126
|
+
|
|
127
|
+
ESSSecurityLabel = rfc2634.ESSSecurityLabel
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
# Equivalent Labels Attribute
|
|
131
|
+
|
|
132
|
+
id_aa_equivalentLabels = rfc2634.id_aa_equivalentLabels
|
|
133
|
+
|
|
134
|
+
EquivalentLabels = rfc2634.EquivalentLabels
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
# Content Identifier Attribute
|
|
138
|
+
|
|
139
|
+
id_aa_contentIdentifier = rfc2634.id_aa_contentIdentifier
|
|
140
|
+
|
|
141
|
+
ContentIdentifier = rfc2634.ContentIdentifier
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
# Content Reference Attribute
|
|
145
|
+
|
|
146
|
+
id_aa_contentReference = rfc2634.id_aa_contentReference
|
|
147
|
+
|
|
148
|
+
ContentReference = rfc2634.ContentReference
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
# Message Signature Digest Attribute
|
|
152
|
+
|
|
153
|
+
id_aa_msgSigDigest = rfc2634.id_aa_msgSigDigest
|
|
154
|
+
|
|
155
|
+
MsgSigDigest = rfc2634.MsgSigDigest
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
# Content Hints Attribute
|
|
159
|
+
|
|
160
|
+
id_aa_contentHint = rfc2634.id_aa_contentHint
|
|
161
|
+
|
|
162
|
+
ContentHints = rfc2634.ContentHints
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
# Receipt Request Attribute
|
|
166
|
+
|
|
167
|
+
AllOrFirstTier = rfc2634.AllOrFirstTier
|
|
168
|
+
|
|
169
|
+
ReceiptsFrom = rfc2634.ReceiptsFrom
|
|
170
|
+
|
|
171
|
+
id_aa_receiptRequest = rfc2634.id_aa_receiptRequest
|
|
172
|
+
|
|
173
|
+
ub_receiptsTo = rfc2634.ub_receiptsTo
|
|
174
|
+
|
|
175
|
+
ReceiptRequest = rfc2634.ReceiptRequest
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
# Receipt Content Type
|
|
179
|
+
|
|
180
|
+
ESSVersion = rfc2634.ESSVersion
|
|
181
|
+
|
|
182
|
+
id_ct_receipt = rfc2634.id_ct_receipt
|
|
183
|
+
|
|
184
|
+
Receipt = rfc2634.Receipt
|
|
185
|
+
|
|
186
|
+
ub_receiptsTo = rfc2634.ub_receiptsTo
|
|
187
|
+
|
|
188
|
+
ReceiptRequest = rfc2634.ReceiptRequest
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
# Update the CMS Attributes Map
|
|
192
|
+
|
|
193
|
+
_cmsAttributesMapUpdate = {
|
|
194
|
+
id_aa_signingCertificateV2: SigningCertificateV2(),
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
cmsAttributesMap.update(_cmsAttributesMapUpdate)
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
# Update the CMS Content Types Map
|
|
201
|
+
|
|
202
|
+
_cmsContentTypesMapUpdate = {
|
|
203
|
+
id_ct_receipt: Receipt(),
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
cmsContentTypesMap.update(_cmsContentTypesMapUpdate)
|