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,469 @@
|
|
|
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
|
+
#
|
|
6
|
+
# Copyright (c) 2019-2024, Vigil Security, LLC
|
|
7
|
+
# License: http://vigilsec.com/pyasn1-alt-modules-license.txt
|
|
8
|
+
#
|
|
9
|
+
# CMS Symmetric Key Package Content Type
|
|
10
|
+
#
|
|
11
|
+
# ASN.1 source from:
|
|
12
|
+
# https://www.rfc-editor.org/rfc/rfc6031.txt
|
|
13
|
+
#
|
|
14
|
+
|
|
15
|
+
from pyasn1.type import char
|
|
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
|
+
from pyasn1.type import useful
|
|
23
|
+
|
|
24
|
+
from pyasn1_alt_modules import rfc5652
|
|
25
|
+
from pyasn1_alt_modules import rfc6019
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _OID(*components):
|
|
29
|
+
output = []
|
|
30
|
+
for x in tuple(components):
|
|
31
|
+
if isinstance(x, univ.ObjectIdentifier):
|
|
32
|
+
output.extend(list(x))
|
|
33
|
+
else:
|
|
34
|
+
output.append(int(x))
|
|
35
|
+
return univ.ObjectIdentifier(output)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
MAX = float('inf')
|
|
39
|
+
|
|
40
|
+
id_pskc = univ.ObjectIdentifier('1.2.840.113549.1.9.16.12')
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
# Symmetric Key Package Attributes
|
|
44
|
+
|
|
45
|
+
id_pskc_manufacturer = _OID(id_pskc, 1)
|
|
46
|
+
|
|
47
|
+
class at_pskc_manufacturer(char.UTF8String):
|
|
48
|
+
pass
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
id_pskc_serialNo = _OID(id_pskc, 2)
|
|
52
|
+
|
|
53
|
+
class at_pskc_serialNo(char.UTF8String):
|
|
54
|
+
pass
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
id_pskc_model = _OID(id_pskc, 3)
|
|
58
|
+
|
|
59
|
+
class at_pskc_model(char.UTF8String):
|
|
60
|
+
pass
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
id_pskc_issueNo = _OID(id_pskc, 4)
|
|
64
|
+
|
|
65
|
+
class at_pskc_issueNo(char.UTF8String):
|
|
66
|
+
pass
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
id_pskc_deviceBinding = _OID(id_pskc, 5)
|
|
70
|
+
|
|
71
|
+
class at_pskc_deviceBinding(char.UTF8String):
|
|
72
|
+
pass
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
id_pskc_deviceStartDate = _OID(id_pskc, 6)
|
|
76
|
+
|
|
77
|
+
class at_pskc_deviceStartDate(useful.GeneralizedTime):
|
|
78
|
+
pass
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
id_pskc_deviceExpiryDate = _OID(id_pskc, 7)
|
|
82
|
+
|
|
83
|
+
class at_pskc_deviceExpiryDate(useful.GeneralizedTime):
|
|
84
|
+
pass
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
id_pskc_moduleId = _OID(id_pskc, 8)
|
|
88
|
+
|
|
89
|
+
class at_pskc_moduleId(char.UTF8String):
|
|
90
|
+
pass
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
id_pskc_deviceUserId = _OID(id_pskc, 26)
|
|
94
|
+
|
|
95
|
+
class at_pskc_deviceUserId(char.UTF8String):
|
|
96
|
+
pass
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
# Symmetric Key Attributes
|
|
100
|
+
|
|
101
|
+
id_pskc_keyId = _OID(id_pskc, 9)
|
|
102
|
+
|
|
103
|
+
class at_pskc_keyUserId(char.UTF8String):
|
|
104
|
+
pass
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
id_pskc_algorithm = _OID(id_pskc, 10)
|
|
108
|
+
|
|
109
|
+
class at_pskc_algorithm(char.UTF8String):
|
|
110
|
+
pass
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
id_pskc_issuer = _OID(id_pskc, 11)
|
|
114
|
+
|
|
115
|
+
class at_pskc_issuer(char.UTF8String):
|
|
116
|
+
pass
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
id_pskc_keyProfileId = _OID(id_pskc, 12)
|
|
120
|
+
|
|
121
|
+
class at_pskc_keyProfileId(char.UTF8String):
|
|
122
|
+
pass
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
id_pskc_keyReference = _OID(id_pskc, 13)
|
|
126
|
+
|
|
127
|
+
class at_pskc_keyReference(char.UTF8String):
|
|
128
|
+
pass
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
id_pskc_friendlyName = _OID(id_pskc, 14)
|
|
132
|
+
|
|
133
|
+
class FriendlyName(univ.Sequence):
|
|
134
|
+
pass
|
|
135
|
+
|
|
136
|
+
FriendlyName.componentType = namedtype.NamedTypes(
|
|
137
|
+
namedtype.NamedType('friendlyName', char.UTF8String()),
|
|
138
|
+
namedtype.OptionalNamedType('friendlyNameLangTag', char.UTF8String())
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
class at_pskc_friendlyName(FriendlyName):
|
|
142
|
+
pass
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
id_pskc_algorithmParameters = _OID(id_pskc, 15)
|
|
146
|
+
|
|
147
|
+
class Encoding(char.UTF8String):
|
|
148
|
+
pass
|
|
149
|
+
|
|
150
|
+
Encoding.namedValues = namedval.NamedValues(
|
|
151
|
+
('dec', "DECIMAL"),
|
|
152
|
+
('hex', "HEXADECIMAL"),
|
|
153
|
+
('alpha', "ALPHANUMERIC"),
|
|
154
|
+
('b64', "BASE64"),
|
|
155
|
+
('bin', "BINARY")
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
Encoding.subtypeSpec = constraint.SingleValueConstraint(
|
|
159
|
+
"DECIMAL", "HEXADECIMAL", "ALPHANUMERIC", "BASE64", "BINARY" )
|
|
160
|
+
|
|
161
|
+
class ChallengeFormat(univ.Sequence):
|
|
162
|
+
pass
|
|
163
|
+
|
|
164
|
+
ChallengeFormat.componentType = namedtype.NamedTypes(
|
|
165
|
+
namedtype.NamedType('encoding', Encoding()),
|
|
166
|
+
namedtype.DefaultedNamedType('checkDigit',
|
|
167
|
+
univ.Boolean().subtype(value=0)),
|
|
168
|
+
namedtype.NamedType('min', univ.Integer().subtype(
|
|
169
|
+
subtypeSpec=constraint.ValueRangeConstraint(0, MAX))),
|
|
170
|
+
namedtype.NamedType('max', univ.Integer().subtype(
|
|
171
|
+
subtypeSpec=constraint.ValueRangeConstraint(0, MAX)))
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
class ResponseFormat(univ.Sequence):
|
|
175
|
+
pass
|
|
176
|
+
|
|
177
|
+
ResponseFormat.componentType = namedtype.NamedTypes(
|
|
178
|
+
namedtype.NamedType('encoding', Encoding()),
|
|
179
|
+
namedtype.NamedType('length', univ.Integer().subtype(
|
|
180
|
+
subtypeSpec=constraint.ValueRangeConstraint(0, MAX))),
|
|
181
|
+
namedtype.DefaultedNamedType('checkDigit',
|
|
182
|
+
univ.Boolean().subtype(value=0))
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
class PSKCAlgorithmParameters(univ.Choice):
|
|
186
|
+
pass
|
|
187
|
+
|
|
188
|
+
PSKCAlgorithmParameters.componentType = namedtype.NamedTypes(
|
|
189
|
+
namedtype.NamedType('suite', char.UTF8String()),
|
|
190
|
+
namedtype.NamedType('challengeFormat', ChallengeFormat().subtype(
|
|
191
|
+
implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0))),
|
|
192
|
+
namedtype.NamedType('responseFormat', ResponseFormat().subtype(
|
|
193
|
+
implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 1)))
|
|
194
|
+
)
|
|
195
|
+
|
|
196
|
+
class at_pskc_algorithmParameters(PSKCAlgorithmParameters):
|
|
197
|
+
pass
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
id_pskc_counter = _OID(id_pskc, 16)
|
|
201
|
+
|
|
202
|
+
class at_pskc_counter(univ.Integer):
|
|
203
|
+
pass
|
|
204
|
+
|
|
205
|
+
at_pskc_counter.subtypeSpec = constraint.ValueRangeConstraint(0, MAX)
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
id_pskc_time = _OID(id_pskc, 17)
|
|
209
|
+
|
|
210
|
+
class at_pskc_time(rfc6019.BinaryTime):
|
|
211
|
+
pass
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
id_pskc_timeInterval = _OID(id_pskc, 18)
|
|
215
|
+
|
|
216
|
+
class at_pskc_timeInterval(univ.Integer):
|
|
217
|
+
pass
|
|
218
|
+
|
|
219
|
+
at_pskc_timeInterval.subtypeSpec = constraint.ValueRangeConstraint(0, MAX)
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
id_pskc_timeDrift = _OID(id_pskc, 19)
|
|
223
|
+
|
|
224
|
+
class at_pskc_timeDrift(univ.Integer):
|
|
225
|
+
pass
|
|
226
|
+
|
|
227
|
+
at_pskc_timeDrift.subtypeSpec = constraint.ValueRangeConstraint(0, MAX)
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
id_pskc_valueMAC = _OID(id_pskc, 20)
|
|
231
|
+
|
|
232
|
+
class ValueMac(univ.Sequence):
|
|
233
|
+
pass
|
|
234
|
+
|
|
235
|
+
ValueMac.componentType = namedtype.NamedTypes(
|
|
236
|
+
namedtype.NamedType('macAlgorithm', char.UTF8String()),
|
|
237
|
+
namedtype.NamedType('mac', char.UTF8String())
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
class at_pskc_valueMAC(ValueMac):
|
|
241
|
+
pass
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
id_pskc_keyUserId = _OID(id_pskc, 27)
|
|
245
|
+
|
|
246
|
+
class at_pskc_keyId(char.UTF8String):
|
|
247
|
+
pass
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
id_pskc_keyStartDate = _OID(id_pskc, 21)
|
|
251
|
+
|
|
252
|
+
class at_pskc_keyStartDate(useful.GeneralizedTime):
|
|
253
|
+
pass
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
id_pskc_keyExpiryDate = _OID(id_pskc, 22)
|
|
257
|
+
|
|
258
|
+
class at_pskc_keyExpiryDate(useful.GeneralizedTime):
|
|
259
|
+
pass
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
id_pskc_numberOfTransactions = _OID(id_pskc, 23)
|
|
263
|
+
|
|
264
|
+
class at_pskc_numberOfTransactions(univ.Integer):
|
|
265
|
+
pass
|
|
266
|
+
|
|
267
|
+
at_pskc_numberOfTransactions.subtypeSpec = constraint.ValueRangeConstraint(0, MAX)
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
id_pskc_keyUsages = _OID(id_pskc, 24)
|
|
271
|
+
|
|
272
|
+
class PSKCKeyUsage(char.UTF8String):
|
|
273
|
+
pass
|
|
274
|
+
|
|
275
|
+
PSKCKeyUsage.namedValues = namedval.NamedValues(
|
|
276
|
+
('otp', "OTP"),
|
|
277
|
+
('cr', "CR"),
|
|
278
|
+
('encrypt', "Encrypt"),
|
|
279
|
+
('integrity', "Integrity"),
|
|
280
|
+
('verify', "Verify"),
|
|
281
|
+
('unlock', "Unlock"),
|
|
282
|
+
('decrypt', "Decrypt"),
|
|
283
|
+
('keywrap', "KeyWrap"),
|
|
284
|
+
('unwrap', "Unwrap"),
|
|
285
|
+
('derive', "Derive"),
|
|
286
|
+
('generate', "Generate")
|
|
287
|
+
)
|
|
288
|
+
|
|
289
|
+
PSKCKeyUsage.subtypeSpec = constraint.SingleValueConstraint(
|
|
290
|
+
"OTP", "CR", "Encrypt", "Integrity", "Verify", "Unlock",
|
|
291
|
+
"Decrypt", "KeyWrap", "Unwrap", "Derive", "Generate" )
|
|
292
|
+
|
|
293
|
+
class PSKCKeyUsages(univ.SequenceOf):
|
|
294
|
+
pass
|
|
295
|
+
|
|
296
|
+
PSKCKeyUsages.componentType = PSKCKeyUsage()
|
|
297
|
+
|
|
298
|
+
class at_pskc_keyUsage(PSKCKeyUsages):
|
|
299
|
+
pass
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
id_pskc_pinPolicy = _OID(id_pskc, 25)
|
|
303
|
+
|
|
304
|
+
class PINUsageMode(char.UTF8String):
|
|
305
|
+
pass
|
|
306
|
+
|
|
307
|
+
PINUsageMode.namedValues = namedval.NamedValues(
|
|
308
|
+
("local", "Local"),
|
|
309
|
+
("prepend", "Prepend"),
|
|
310
|
+
("append", "Append"),
|
|
311
|
+
("algorithmic", "Algorithmic")
|
|
312
|
+
)
|
|
313
|
+
|
|
314
|
+
PINUsageMode.subtypeSpec = constraint.SingleValueConstraint(
|
|
315
|
+
"Local", "Prepend", "Append", "Algorithmic" )
|
|
316
|
+
|
|
317
|
+
class PINPolicy(univ.Sequence):
|
|
318
|
+
pass
|
|
319
|
+
|
|
320
|
+
PINPolicy.componentType = namedtype.NamedTypes(
|
|
321
|
+
namedtype.OptionalNamedType('pinKeyId', char.UTF8String().subtype(
|
|
322
|
+
implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
|
|
323
|
+
namedtype.NamedType('pinUsageMode', PINUsageMode().subtype(
|
|
324
|
+
implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
|
|
325
|
+
namedtype.OptionalNamedType('maxFailedAttempts', univ.Integer().subtype(
|
|
326
|
+
subtypeSpec=constraint.ValueRangeConstraint(0, MAX)).subtype(
|
|
327
|
+
implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2))),
|
|
328
|
+
namedtype.OptionalNamedType('minLength', univ.Integer().subtype(
|
|
329
|
+
subtypeSpec=constraint.ValueRangeConstraint(0, MAX)).subtype(
|
|
330
|
+
implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 3))),
|
|
331
|
+
namedtype.OptionalNamedType('maxLength', univ.Integer().subtype(
|
|
332
|
+
subtypeSpec=constraint.ValueRangeConstraint(0, MAX)).subtype(
|
|
333
|
+
implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 4))),
|
|
334
|
+
namedtype.OptionalNamedType('pinEncoding', Encoding().subtype(
|
|
335
|
+
implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 5)))
|
|
336
|
+
)
|
|
337
|
+
|
|
338
|
+
class at_pskc_pinPolicy(PINPolicy):
|
|
339
|
+
pass
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
# Map of Symmetric Key Package Attribute OIDs to Attributes
|
|
343
|
+
|
|
344
|
+
sKeyPkgAttributesMap = {
|
|
345
|
+
id_pskc_manufacturer: at_pskc_manufacturer(),
|
|
346
|
+
id_pskc_serialNo: at_pskc_serialNo(),
|
|
347
|
+
id_pskc_model: at_pskc_model(),
|
|
348
|
+
id_pskc_issueNo: at_pskc_issueNo(),
|
|
349
|
+
id_pskc_deviceBinding: at_pskc_deviceBinding(),
|
|
350
|
+
id_pskc_deviceStartDate: at_pskc_deviceStartDate(),
|
|
351
|
+
id_pskc_deviceExpiryDate: at_pskc_deviceExpiryDate(),
|
|
352
|
+
id_pskc_moduleId: at_pskc_moduleId(),
|
|
353
|
+
id_pskc_deviceUserId: at_pskc_deviceUserId(),
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
# Map of Symmetric Key Attribute OIDs to Attributes
|
|
358
|
+
|
|
359
|
+
sKeyAttributesMap = {
|
|
360
|
+
id_pskc_keyId: at_pskc_keyId(),
|
|
361
|
+
id_pskc_algorithm: at_pskc_algorithm(),
|
|
362
|
+
id_pskc_issuer: at_pskc_issuer(),
|
|
363
|
+
id_pskc_keyProfileId: at_pskc_keyProfileId(),
|
|
364
|
+
id_pskc_keyReference: at_pskc_keyReference(),
|
|
365
|
+
id_pskc_friendlyName: at_pskc_friendlyName(),
|
|
366
|
+
id_pskc_algorithmParameters: at_pskc_algorithmParameters(),
|
|
367
|
+
id_pskc_counter: at_pskc_counter(),
|
|
368
|
+
id_pskc_time: at_pskc_time(),
|
|
369
|
+
id_pskc_timeInterval: at_pskc_timeInterval(),
|
|
370
|
+
id_pskc_timeDrift: at_pskc_timeDrift(),
|
|
371
|
+
id_pskc_valueMAC: at_pskc_valueMAC(),
|
|
372
|
+
id_pskc_keyUserId: at_pskc_keyUserId(),
|
|
373
|
+
id_pskc_keyStartDate: at_pskc_keyStartDate(),
|
|
374
|
+
id_pskc_keyExpiryDate: at_pskc_keyExpiryDate(),
|
|
375
|
+
id_pskc_numberOfTransactions: at_pskc_numberOfTransactions(),
|
|
376
|
+
id_pskc_keyUsages: at_pskc_keyUsage(),
|
|
377
|
+
id_pskc_pinPolicy: at_pskc_pinPolicy(),
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
# This definition replaces Attribute() from rfc5652.py; it is the same except
|
|
382
|
+
# that opentype is added with sKeyPkgAttributesMap and sKeyAttributesMap
|
|
383
|
+
|
|
384
|
+
class AttributeType(univ.ObjectIdentifier):
|
|
385
|
+
pass
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
class AttributeValue(univ.Any):
|
|
389
|
+
pass
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
class SKeyAttribute(univ.Sequence):
|
|
393
|
+
pass
|
|
394
|
+
|
|
395
|
+
SKeyAttribute.componentType = namedtype.NamedTypes(
|
|
396
|
+
namedtype.NamedType('attrType', AttributeType()),
|
|
397
|
+
namedtype.NamedType('attrValues',
|
|
398
|
+
univ.SetOf(componentType=AttributeValue()),
|
|
399
|
+
openType=opentype.OpenType('attrType', sKeyAttributesMap)
|
|
400
|
+
)
|
|
401
|
+
)
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
class SKeyPkgAttribute(univ.Sequence):
|
|
405
|
+
pass
|
|
406
|
+
|
|
407
|
+
SKeyPkgAttribute.componentType = namedtype.NamedTypes(
|
|
408
|
+
namedtype.NamedType('attrType', AttributeType()),
|
|
409
|
+
namedtype.NamedType('attrValues',
|
|
410
|
+
univ.SetOf(componentType=AttributeValue()),
|
|
411
|
+
openType=opentype.OpenType('attrType', sKeyPkgAttributesMap)
|
|
412
|
+
)
|
|
413
|
+
)
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
# Symmetric Key Package Content Type
|
|
417
|
+
|
|
418
|
+
id_ct_KP_sKeyPackage = univ.ObjectIdentifier('1.2.840.113549.1.9.16.1.25')
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
class KeyPkgVersion(univ.Integer):
|
|
422
|
+
pass
|
|
423
|
+
|
|
424
|
+
KeyPkgVersion.namedValues = namedval.NamedValues(
|
|
425
|
+
('v1', 1)
|
|
426
|
+
)
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
class OneSymmetricKey(univ.Sequence):
|
|
430
|
+
pass
|
|
431
|
+
|
|
432
|
+
OneSymmetricKey.componentType = namedtype.NamedTypes(
|
|
433
|
+
namedtype.OptionalNamedType('sKeyAttrs',
|
|
434
|
+
univ.SequenceOf(componentType=SKeyAttribute()).subtype(
|
|
435
|
+
subtypeSpec=constraint.ValueSizeConstraint(1, MAX))),
|
|
436
|
+
namedtype.OptionalNamedType('sKey', univ.OctetString())
|
|
437
|
+
)
|
|
438
|
+
|
|
439
|
+
OneSymmetricKey.sizeSpec = univ.Sequence.sizeSpec + constraint.ValueSizeConstraint(1, 2)
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
class SymmetricKeys(univ.SequenceOf):
|
|
443
|
+
pass
|
|
444
|
+
|
|
445
|
+
SymmetricKeys.componentType = OneSymmetricKey()
|
|
446
|
+
SymmetricKeys.subtypeSpec=constraint.ValueSizeConstraint(1, MAX)
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
class SymmetricKeyPackage(univ.Sequence):
|
|
450
|
+
pass
|
|
451
|
+
|
|
452
|
+
SymmetricKeyPackage.componentType = namedtype.NamedTypes(
|
|
453
|
+
namedtype.DefaultedNamedType('version', KeyPkgVersion().subtype(value='v1')),
|
|
454
|
+
namedtype.OptionalNamedType('sKeyPkgAttrs',
|
|
455
|
+
univ.SequenceOf(componentType=SKeyPkgAttribute()).subtype(
|
|
456
|
+
subtypeSpec=constraint.ValueSizeConstraint(1, MAX),
|
|
457
|
+
implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
|
|
458
|
+
namedtype.NamedType('sKeys', SymmetricKeys())
|
|
459
|
+
)
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
# Map of Content Type OIDs to Content Types are
|
|
463
|
+
# added to the ones that are in rfc5652.py
|
|
464
|
+
|
|
465
|
+
_cmsContentTypesMapUpdate = {
|
|
466
|
+
id_ct_KP_sKeyPackage: SymmetricKeyPackage(),
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
rfc5652.cmsContentTypesMap.update(_cmsContentTypesMapUpdate)
|
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
# CMS Encrypted Key Package Content Type
|
|
11
|
+
#
|
|
12
|
+
# ASN.1 source from:
|
|
13
|
+
# https://www.rfc-editor.org/rfc/rfc6032.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_alt_modules import rfc5652
|
|
21
|
+
from pyasn1_alt_modules import rfc5083
|
|
22
|
+
from pyasn1_alt_modules import opentypemap
|
|
23
|
+
|
|
24
|
+
cmsContentTypesMap = opentypemap.get('cmsContentTypesMap')
|
|
25
|
+
|
|
26
|
+
cmsAttributesMap = opentypemap.get('cmsAttributesMap')
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
# Content Decryption Key Identifier attribute
|
|
30
|
+
|
|
31
|
+
id_aa_KP_contentDecryptKeyID = univ.ObjectIdentifier('2.16.840.1.101.2.1.5.66')
|
|
32
|
+
|
|
33
|
+
class ContentDecryptKeyID(univ.OctetString):
|
|
34
|
+
pass
|
|
35
|
+
|
|
36
|
+
aa_content_decrypt_key_identifier = rfc5652.Attribute()
|
|
37
|
+
aa_content_decrypt_key_identifier['attrType'] = id_aa_KP_contentDecryptKeyID
|
|
38
|
+
aa_content_decrypt_key_identifier['attrValues'][0] = ContentDecryptKeyID()
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
# Encrypted Key Package Content Type
|
|
42
|
+
|
|
43
|
+
id_ct_KP_encryptedKeyPkg = univ.ObjectIdentifier('2.16.840.1.101.2.1.2.78.2')
|
|
44
|
+
|
|
45
|
+
class EncryptedKeyPackage(univ.Choice):
|
|
46
|
+
pass
|
|
47
|
+
|
|
48
|
+
EncryptedKeyPackage.componentType = namedtype.NamedTypes(
|
|
49
|
+
namedtype.NamedType('encrypted', rfc5652.EncryptedData()),
|
|
50
|
+
namedtype.NamedType('enveloped', rfc5652.EnvelopedData().subtype(
|
|
51
|
+
implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
|
|
52
|
+
namedtype.NamedType('authEnveloped', rfc5083.AuthEnvelopedData().subtype(
|
|
53
|
+
implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)))
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
# Update the CMS Attributes Map
|
|
58
|
+
|
|
59
|
+
_cmsAttributesMapUpdate = {
|
|
60
|
+
id_aa_KP_contentDecryptKeyID: ContentDecryptKeyID(),
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
cmsAttributesMap.update(_cmsAttributesMapUpdate)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
# Update the CMS Content Types Map
|
|
67
|
+
_cmsContentTypesMapUpdate = {
|
|
68
|
+
id_ct_KP_encryptedKeyPkg: EncryptedKeyPackage(),
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
cmsContentTypesMap.update(_cmsContentTypesMapUpdate)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file is part of pyasn1-alt-modules software.
|
|
3
|
+
#
|
|
4
|
+
# Created by Russ Housley.
|
|
5
|
+
#
|
|
6
|
+
# Copyright (c) 2021-2024, Vigil Security, LLC
|
|
7
|
+
# License: http://vigilsec.com/pyasn1-alt-modules-license.txt
|
|
8
|
+
#
|
|
9
|
+
# PkiPath for the pkix-pkipath media type
|
|
10
|
+
#
|
|
11
|
+
# ASN.1 source from:
|
|
12
|
+
# https://www.rfc-editor.org/rfc/rfc6066.txt
|
|
13
|
+
#
|
|
14
|
+
|
|
15
|
+
from pyasn1_alt_modules import rfc5280
|
|
16
|
+
|
|
17
|
+
from pyasn1.type import constraint
|
|
18
|
+
from pyasn1.type import univ
|
|
19
|
+
|
|
20
|
+
MAX = float('inf')
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class PkiPath(univ.SequenceOf):
|
|
24
|
+
componentType = rfc5280.Certificate()
|
|
25
|
+
subtypeSpec = constraint.ValueSizeConstraint(1, MAX)
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
# Extensible Messaging and Presence Protocol (XMPP)
|
|
11
|
+
#
|
|
12
|
+
# ASN.1 source from:
|
|
13
|
+
# https://www.rfc-editor.org/rfc/rfc6120.txt
|
|
14
|
+
#
|
|
15
|
+
|
|
16
|
+
from pyasn1.type import char
|
|
17
|
+
from pyasn1.type import univ
|
|
18
|
+
|
|
19
|
+
from pyasn1_alt_modules import rfc5280
|
|
20
|
+
from pyasn1_alt_modules import opentypemap
|
|
21
|
+
|
|
22
|
+
otherNamesMap = opentypemap.get('otherNamesMap')
|
|
23
|
+
|
|
24
|
+
MAX = float('inf')
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
# XmppAddr Identifier Type as specified in Section 13.7.1.4. of RFC 6120
|
|
28
|
+
|
|
29
|
+
id_pkix = rfc5280.id_pkix
|
|
30
|
+
|
|
31
|
+
id_on = id_pkix + (8, )
|
|
32
|
+
|
|
33
|
+
id_on_xmppAddr = id_on + (5, )
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class XmppAddr(char.UTF8String):
|
|
37
|
+
pass
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
# Update the Other Names Map
|
|
41
|
+
|
|
42
|
+
_otherNamesMapUpdate = {
|
|
43
|
+
id_on_xmppAddr: XmppAddr(),
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
otherNamesMap.update(_otherNamesMapUpdate)
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
# Certificate Image in the Internet X.509 Public Key Infrastructure
|
|
10
|
+
#
|
|
11
|
+
# ASN.1 source from:
|
|
12
|
+
# https://www.rfc-editor.org/rfc/rfc6170.txt
|
|
13
|
+
#
|
|
14
|
+
|
|
15
|
+
from pyasn1.type import univ
|
|
16
|
+
|
|
17
|
+
id_logo_certImage = univ.ObjectIdentifier('1.3.6.1.5.5.7.20.3')
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
# X.509v3 Certificates for Secure Shell Authentication
|
|
10
|
+
#
|
|
11
|
+
# ASN.1 source from:
|
|
12
|
+
# https://www.rfc-editor.org/rfc/rfc6187.txt
|
|
13
|
+
#
|
|
14
|
+
|
|
15
|
+
from pyasn1.type import univ
|
|
16
|
+
|
|
17
|
+
id_pkix = univ.ObjectIdentifier('1.3.6.1.5.5.7')
|
|
18
|
+
|
|
19
|
+
id_kp = id_pkix + (3, )
|
|
20
|
+
|
|
21
|
+
id_kp_secureShellClient = id_kp + (21, )
|
|
22
|
+
id_kp_secureShellServer = id_kp + (22, )
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
# Experiment for Hash Functions with Parameters in the CMS
|
|
11
|
+
#
|
|
12
|
+
# ASN.1 source from:
|
|
13
|
+
# https://www.rfc-editor.org/rfc/rfc6210.txt
|
|
14
|
+
#
|
|
15
|
+
|
|
16
|
+
from pyasn1.type import constraint
|
|
17
|
+
from pyasn1.type import univ
|
|
18
|
+
|
|
19
|
+
from pyasn1_alt_modules import rfc5280
|
|
20
|
+
from pyasn1_alt_modules import opentypemap
|
|
21
|
+
|
|
22
|
+
algorithmIdentifierMap = opentypemap.get('algorithmIdentifierMap')
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# MD5-XOR Experimental Message Digest Algorithm
|
|
26
|
+
|
|
27
|
+
id_alg_MD5_XOR_EXPERIMENT = univ.ObjectIdentifier('1.2.840.113549.1.9.16.3.13')
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class MD5_XOR_EXPERIMENT(univ.OctetString):
|
|
31
|
+
subtypeSpec = constraint.ValueSizeConstraint(64, 64)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
mda_xor_md5_EXPERIMENT = rfc5280.AlgorithmIdentifier()
|
|
35
|
+
mda_xor_md5_EXPERIMENT['algorithm'] = id_alg_MD5_XOR_EXPERIMENT
|
|
36
|
+
mda_xor_md5_EXPERIMENT['parameters'] = MD5_XOR_EXPERIMENT()
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
# Update the Algorithm Identifier Map and the S/MIME Capability Map
|
|
40
|
+
|
|
41
|
+
_algorithmIdentifierMapUpdate = {
|
|
42
|
+
id_alg_MD5_XOR_EXPERIMENT: MD5_XOR_EXPERIMENT(),
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
algorithmIdentifierMap.update(_algorithmIdentifierMapUpdate)
|