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.

Files changed (195) hide show
  1. pyasn1_alt_modules/__init__.py +2 -0
  2. pyasn1_alt_modules/opentypemap.py +19 -0
  3. pyasn1_alt_modules/pem.py +66 -0
  4. pyasn1_alt_modules/rfc1155.py +97 -0
  5. pyasn1_alt_modules/rfc1157.py +127 -0
  6. pyasn1_alt_modules/rfc1901.py +23 -0
  7. pyasn1_alt_modules/rfc1902.py +130 -0
  8. pyasn1_alt_modules/rfc1905.py +136 -0
  9. pyasn1_alt_modules/rfc2040.py +50 -0
  10. pyasn1_alt_modules/rfc2251.py +564 -0
  11. pyasn1_alt_modules/rfc2314.py +68 -0
  12. pyasn1_alt_modules/rfc2315.py +325 -0
  13. pyasn1_alt_modules/rfc2437.py +70 -0
  14. pyasn1_alt_modules/rfc2459.py +1340 -0
  15. pyasn1_alt_modules/rfc2511.py +303 -0
  16. pyasn1_alt_modules/rfc2528.py +34 -0
  17. pyasn1_alt_modules/rfc2560.py +226 -0
  18. pyasn1_alt_modules/rfc2631.py +37 -0
  19. pyasn1_alt_modules/rfc2634.py +342 -0
  20. pyasn1_alt_modules/rfc2743.py +60 -0
  21. pyasn1_alt_modules/rfc2876.py +61 -0
  22. pyasn1_alt_modules/rfc2898.py +72 -0
  23. pyasn1_alt_modules/rfc2985.py +593 -0
  24. pyasn1_alt_modules/rfc2986.py +76 -0
  25. pyasn1_alt_modules/rfc3058.py +48 -0
  26. pyasn1_alt_modules/rfc3114.py +80 -0
  27. pyasn1_alt_modules/rfc3125.py +469 -0
  28. pyasn1_alt_modules/rfc3161.py +142 -0
  29. pyasn1_alt_modules/rfc3217.py +42 -0
  30. pyasn1_alt_modules/rfc3274.py +62 -0
  31. pyasn1_alt_modules/rfc3279.py +264 -0
  32. pyasn1_alt_modules/rfc3280.py +1544 -0
  33. pyasn1_alt_modules/rfc3281.py +332 -0
  34. pyasn1_alt_modules/rfc3370.py +142 -0
  35. pyasn1_alt_modules/rfc3412.py +54 -0
  36. pyasn1_alt_modules/rfc3414.py +29 -0
  37. pyasn1_alt_modules/rfc3447.py +46 -0
  38. pyasn1_alt_modules/rfc3537.py +44 -0
  39. pyasn1_alt_modules/rfc3546.py +23 -0
  40. pyasn1_alt_modules/rfc3560.py +74 -0
  41. pyasn1_alt_modules/rfc3565.py +59 -0
  42. pyasn1_alt_modules/rfc3657.py +69 -0
  43. pyasn1_alt_modules/rfc3709.py +230 -0
  44. pyasn1_alt_modules/rfc3739.py +207 -0
  45. pyasn1_alt_modules/rfc3770.py +77 -0
  46. pyasn1_alt_modules/rfc3779.py +139 -0
  47. pyasn1_alt_modules/rfc3820.py +66 -0
  48. pyasn1_alt_modules/rfc3852.py +707 -0
  49. pyasn1_alt_modules/rfc3874.py +29 -0
  50. pyasn1_alt_modules/rfc4010.py +58 -0
  51. pyasn1_alt_modules/rfc4043.py +45 -0
  52. pyasn1_alt_modules/rfc4055.py +285 -0
  53. pyasn1_alt_modules/rfc4056.py +56 -0
  54. pyasn1_alt_modules/rfc4059.py +101 -0
  55. pyasn1_alt_modules/rfc4073.py +62 -0
  56. pyasn1_alt_modules/rfc4108.py +355 -0
  57. pyasn1_alt_modules/rfc4210.py +807 -0
  58. pyasn1_alt_modules/rfc4211.py +420 -0
  59. pyasn1_alt_modules/rfc4231.py +38 -0
  60. pyasn1_alt_modules/rfc4262.py +37 -0
  61. pyasn1_alt_modules/rfc4334.py +78 -0
  62. pyasn1_alt_modules/rfc4357.py +485 -0
  63. pyasn1_alt_modules/rfc4366.py +23 -0
  64. pyasn1_alt_modules/rfc4387.py +23 -0
  65. pyasn1_alt_modules/rfc4476.py +99 -0
  66. pyasn1_alt_modules/rfc4490.py +119 -0
  67. pyasn1_alt_modules/rfc4491.py +44 -0
  68. pyasn1_alt_modules/rfc4683.py +76 -0
  69. pyasn1_alt_modules/rfc4985.py +52 -0
  70. pyasn1_alt_modules/rfc4998.py +125 -0
  71. pyasn1_alt_modules/rfc5035.py +206 -0
  72. pyasn1_alt_modules/rfc5055.py +763 -0
  73. pyasn1_alt_modules/rfc5083.py +55 -0
  74. pyasn1_alt_modules/rfc5084.py +94 -0
  75. pyasn1_alt_modules/rfc5126.py +578 -0
  76. pyasn1_alt_modules/rfc5208.py +73 -0
  77. pyasn1_alt_modules/rfc5275.py +404 -0
  78. pyasn1_alt_modules/rfc5276.py +82 -0
  79. pyasn1_alt_modules/rfc5280.py +1666 -0
  80. pyasn1_alt_modules/rfc5480.py +190 -0
  81. pyasn1_alt_modules/rfc5544.py +127 -0
  82. pyasn1_alt_modules/rfc5636.py +117 -0
  83. pyasn1_alt_modules/rfc5639.py +49 -0
  84. pyasn1_alt_modules/rfc5649.py +33 -0
  85. pyasn1_alt_modules/rfc5652.py +763 -0
  86. pyasn1_alt_modules/rfc5697.py +64 -0
  87. pyasn1_alt_modules/rfc5698.py +159 -0
  88. pyasn1_alt_modules/rfc5751.py +127 -0
  89. pyasn1_alt_modules/rfc5752.py +52 -0
  90. pyasn1_alt_modules/rfc5753.py +163 -0
  91. pyasn1_alt_modules/rfc5755.py +400 -0
  92. pyasn1_alt_modules/rfc5913.py +46 -0
  93. pyasn1_alt_modules/rfc5914.py +119 -0
  94. pyasn1_alt_modules/rfc5915.py +32 -0
  95. pyasn1_alt_modules/rfc5916.py +39 -0
  96. pyasn1_alt_modules/rfc5917.py +59 -0
  97. pyasn1_alt_modules/rfc5924.py +19 -0
  98. pyasn1_alt_modules/rfc5934.py +786 -0
  99. pyasn1_alt_modules/rfc5940.py +62 -0
  100. pyasn1_alt_modules/rfc5958.py +100 -0
  101. pyasn1_alt_modules/rfc5990.py +238 -0
  102. pyasn1_alt_modules/rfc6010.py +92 -0
  103. pyasn1_alt_modules/rfc6019.py +46 -0
  104. pyasn1_alt_modules/rfc6031.py +469 -0
  105. pyasn1_alt_modules/rfc6032.py +71 -0
  106. pyasn1_alt_modules/rfc6066.py +25 -0
  107. pyasn1_alt_modules/rfc6120.py +46 -0
  108. pyasn1_alt_modules/rfc6170.py +17 -0
  109. pyasn1_alt_modules/rfc6187.py +22 -0
  110. pyasn1_alt_modules/rfc6210.py +45 -0
  111. pyasn1_alt_modules/rfc6211.py +75 -0
  112. pyasn1_alt_modules/rfc6402.py +643 -0
  113. pyasn1_alt_modules/rfc6482.py +77 -0
  114. pyasn1_alt_modules/rfc6484.py +17 -0
  115. pyasn1_alt_modules/rfc6486.py +70 -0
  116. pyasn1_alt_modules/rfc6487.py +22 -0
  117. pyasn1_alt_modules/rfc6492.py +41 -0
  118. pyasn1_alt_modules/rfc6493.py +24 -0
  119. pyasn1_alt_modules/rfc6494.py +23 -0
  120. pyasn1_alt_modules/rfc6664.py +151 -0
  121. pyasn1_alt_modules/rfc6955.py +112 -0
  122. pyasn1_alt_modules/rfc6960.py +234 -0
  123. pyasn1_alt_modules/rfc6962.py +52 -0
  124. pyasn1_alt_modules/rfc7030.py +70 -0
  125. pyasn1_alt_modules/rfc7191.py +267 -0
  126. pyasn1_alt_modules/rfc7229.py +29 -0
  127. pyasn1_alt_modules/rfc7292.py +359 -0
  128. pyasn1_alt_modules/rfc7296.py +32 -0
  129. pyasn1_alt_modules/rfc7508.py +92 -0
  130. pyasn1_alt_modules/rfc7585.py +53 -0
  131. pyasn1_alt_modules/rfc7633.py +40 -0
  132. pyasn1_alt_modules/rfc7693.py +66 -0
  133. pyasn1_alt_modules/rfc7773.py +54 -0
  134. pyasn1_alt_modules/rfc7836.py +65 -0
  135. pyasn1_alt_modules/rfc7894.py +100 -0
  136. pyasn1_alt_modules/rfc7906.py +739 -0
  137. pyasn1_alt_modules/rfc7914.py +55 -0
  138. pyasn1_alt_modules/rfc8017.py +159 -0
  139. pyasn1_alt_modules/rfc8018.py +269 -0
  140. pyasn1_alt_modules/rfc8103.py +36 -0
  141. pyasn1_alt_modules/rfc8209.py +20 -0
  142. pyasn1_alt_modules/rfc8226.py +151 -0
  143. pyasn1_alt_modules/rfc8358.py +54 -0
  144. pyasn1_alt_modules/rfc8360.py +46 -0
  145. pyasn1_alt_modules/rfc8398.py +55 -0
  146. pyasn1_alt_modules/rfc8410.py +43 -0
  147. pyasn1_alt_modules/rfc8418.py +36 -0
  148. pyasn1_alt_modules/rfc8419.py +70 -0
  149. pyasn1_alt_modules/rfc8479.py +48 -0
  150. pyasn1_alt_modules/rfc8494.py +80 -0
  151. pyasn1_alt_modules/rfc8520.py +66 -0
  152. pyasn1_alt_modules/rfc8619.py +45 -0
  153. pyasn1_alt_modules/rfc8649.py +42 -0
  154. pyasn1_alt_modules/rfc8692.py +79 -0
  155. pyasn1_alt_modules/rfc8696.py +108 -0
  156. pyasn1_alt_modules/rfc8702.py +109 -0
  157. pyasn1_alt_modules/rfc8708.py +43 -0
  158. pyasn1_alt_modules/rfc8737.py +36 -0
  159. pyasn1_alt_modules/rfc8769.py +21 -0
  160. pyasn1_alt_modules/rfc8894.py +52 -0
  161. pyasn1_alt_modules/rfc8951.py +42 -0
  162. pyasn1_alt_modules/rfc8954.py +238 -0
  163. pyasn1_alt_modules/rfc8994.py +52 -0
  164. pyasn1_alt_modules/rfc8995.py +39 -0
  165. pyasn1_alt_modules/rfc9044.py +80 -0
  166. pyasn1_alt_modules/rfc9092.py +35 -0
  167. pyasn1_alt_modules/rfc9118.py +82 -0
  168. pyasn1_alt_modules/rfc9174.py +55 -0
  169. pyasn1_alt_modules/rfc9189.py +74 -0
  170. pyasn1_alt_modules/rfc9215.py +228 -0
  171. pyasn1_alt_modules/rfc9286.py +78 -0
  172. pyasn1_alt_modules/rfc9289.py +22 -0
  173. pyasn1_alt_modules/rfc9310.py +46 -0
  174. pyasn1_alt_modules/rfc9323.py +129 -0
  175. pyasn1_alt_modules/rfc9336.py +20 -0
  176. pyasn1_alt_modules/rfc9337.py +74 -0
  177. pyasn1_alt_modules/rfc9345.py +36 -0
  178. pyasn1_alt_modules/rfc9385.py +22 -0
  179. pyasn1_alt_modules/rfc9399.py +59 -0
  180. pyasn1_alt_modules/rfc9480.py +731 -0
  181. pyasn1_alt_modules/rfc9481.py +224 -0
  182. pyasn1_alt_modules/rfc9509.py +24 -0
  183. pyasn1_alt_modules/rfc9548.py +23 -0
  184. pyasn1_alt_modules/rfc9579.py +89 -0
  185. pyasn1_alt_modules/rfc9582.py +107 -0
  186. pyasn1_alt_modules/rfc9598.py +52 -0
  187. pyasn1_alt_modules/rfc9608.py +35 -0
  188. pyasn1_alt_modules/rfc9629.py +100 -0
  189. pyasn1_alt_modules/rfc9654.py +241 -0
  190. pyasn1_alt_modules-0.4.5.dist-info/LICENSE.txt +25 -0
  191. pyasn1_alt_modules-0.4.5.dist-info/METADATA +34 -0
  192. pyasn1_alt_modules-0.4.5.dist-info/RECORD +195 -0
  193. pyasn1_alt_modules-0.4.5.dist-info/WHEEL +5 -0
  194. pyasn1_alt_modules-0.4.5.dist-info/top_level.txt +1 -0
  195. pyasn1_alt_modules-0.4.5.dist-info/zip-safe +1 -0
@@ -0,0 +1,75 @@
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 Algorithm Identifier Protection Attribute
11
+ #
12
+ # ASN.1 source from:
13
+ # https://www.rfc-editor.org/rfc/rfc6211.txt
14
+ #
15
+
16
+ from pyasn1.type import constraint
17
+ from pyasn1.type import namedtype
18
+ from pyasn1.type import tag
19
+ from pyasn1.type import univ
20
+
21
+ from pyasn1_alt_modules import rfc5652
22
+ from pyasn1_alt_modules import opentypemap
23
+
24
+ cmsAttributesMap = opentypemap.get('cmsAttributesMap')
25
+
26
+
27
+ # Imports from RFC 5652
28
+
29
+ DigestAlgorithmIdentifier = rfc5652.DigestAlgorithmIdentifier
30
+
31
+ MessageAuthenticationCodeAlgorithm = rfc5652.MessageAuthenticationCodeAlgorithm
32
+
33
+ SignatureAlgorithmIdentifier = rfc5652.SignatureAlgorithmIdentifier
34
+
35
+
36
+ # CMS Algorithm Protection attribute
37
+
38
+ id_aa_cmsAlgorithmProtect = univ.ObjectIdentifier('1.2.840.113549.1.9.52')
39
+
40
+
41
+ class CMSAlgorithmProtection(univ.Sequence):
42
+ pass
43
+
44
+ CMSAlgorithmProtection.componentType = namedtype.NamedTypes(
45
+ namedtype.NamedType('digestAlgorithm', DigestAlgorithmIdentifier()),
46
+ namedtype.OptionalNamedType('signatureAlgorithm',
47
+ SignatureAlgorithmIdentifier().subtype(
48
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
49
+ namedtype.OptionalNamedType('macAlgorithm',
50
+ MessageAuthenticationCodeAlgorithm().subtype(
51
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2)))
52
+ )
53
+
54
+ CMSAlgorithmProtection.subtypeSpec = constraint.ConstraintsUnion(
55
+ constraint.WithComponentsConstraint(
56
+ ('signatureAlgorithm', constraint.ComponentPresentConstraint()),
57
+ ('macAlgorithm', constraint.ComponentAbsentConstraint())),
58
+ constraint.WithComponentsConstraint(
59
+ ('signatureAlgorithm', constraint.ComponentAbsentConstraint()),
60
+ ('macAlgorithm', constraint.ComponentPresentConstraint()))
61
+ )
62
+
63
+
64
+ aa_cmsAlgorithmProtection = rfc5652.Attribute()
65
+ aa_cmsAlgorithmProtection['attrType'] = id_aa_cmsAlgorithmProtect
66
+ aa_cmsAlgorithmProtection['attrValues'][0] = CMSAlgorithmProtection()
67
+
68
+
69
+ # Update the CMS Attributes Map
70
+
71
+ _cmsAttributesMapUpdate = {
72
+ id_aa_cmsAlgorithmProtect: CMSAlgorithmProtection(),
73
+ }
74
+
75
+ cmsAttributesMap.update(_cmsAttributesMapUpdate)
@@ -0,0 +1,643 @@
1
+ # coding: utf-8
2
+ #
3
+ # This file is part of pyasn1-alt-modules software.
4
+ #
5
+ # Created by Stanisław Pitucha with asn1ate tool.
6
+ # Modified by Russ Housley to add a maps for CMC Control Attributes
7
+ # and CMC Content Types for use with opentypes.
8
+ # Modified by Russ Housley to include the opentypemap manager.
9
+ # Modified by Russ Housley for errata 3943, 5931, and 6571.
10
+ #
11
+ # Copyright (c) 2005-2020, Ilya Etingof <etingof@gmail.com>
12
+ # Copyright (c) 2021-2024, Vigil Security, LLC
13
+ # License: http://vigilsec.com/pyasn1-alt-modules-license.txt
14
+ #
15
+ # Certificate Management over CMS (CMC) Updates
16
+ #
17
+ # ASN.1 source from:
18
+ # https://www.rfc-editor.org/rfc/rfc6402.txt
19
+ # https://www.rfc-editor.org/errata/eid3943
20
+ # https://www.rfc-editor.org/errata/eid5931
21
+ # https://www.rfc-editor.org/errata/eid6571
22
+ #
23
+ from pyasn1.type import char
24
+ from pyasn1.type import constraint
25
+ from pyasn1.type import namedtype
26
+ from pyasn1.type import namedval
27
+ from pyasn1.type import opentype
28
+ from pyasn1.type import tag
29
+ from pyasn1.type import univ
30
+ from pyasn1.type import useful
31
+
32
+ from pyasn1_alt_modules import rfc4211
33
+ from pyasn1_alt_modules import rfc5280
34
+ from pyasn1_alt_modules import rfc5652
35
+ from pyasn1_alt_modules import opentypemap
36
+
37
+ MAX = float('inf')
38
+
39
+
40
+ def _buildOid(*components):
41
+ output = []
42
+ for x in tuple(components):
43
+ if isinstance(x, univ.ObjectIdentifier):
44
+ output.extend(list(x))
45
+ else:
46
+ output.append(int(x))
47
+
48
+ return univ.ObjectIdentifier(output)
49
+
50
+
51
+ # Since CMS Attributes and CMC Controls both use 'attrType', one map is used
52
+
53
+ cmsAttributesMap = opentypemap.get('cmsAttributesMap')
54
+
55
+ cmcControlAttributesMap = cmsAttributesMap
56
+
57
+ cmsContentTypesMap = opentypemap.get('cmsContentTypesMap')
58
+
59
+
60
+ class ChangeSubjectName(univ.Sequence):
61
+ pass
62
+
63
+
64
+ # https://www.rfc-editor.org/errata/eid3943
65
+ ChangeSubjectName.componentType = namedtype.NamedTypes(
66
+ namedtype.OptionalNamedType('subject', rfc5280.Name()),
67
+ namedtype.OptionalNamedType('subjectAlt', rfc5280.GeneralNames().subtype(
68
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)))
69
+ )
70
+
71
+
72
+ class AttributeValue(univ.Any):
73
+ pass
74
+
75
+
76
+ class CMCStatus(univ.Integer):
77
+ pass
78
+
79
+
80
+ CMCStatus.namedValues = namedval.NamedValues(
81
+ ('success', 0),
82
+ ('failed', 2),
83
+ ('pending', 3),
84
+ ('noSupport', 4),
85
+ ('confirmRequired', 5),
86
+ ('popRequired', 6),
87
+ ('partial', 7)
88
+ )
89
+
90
+
91
+ class PendInfo(univ.Sequence):
92
+ pass
93
+
94
+
95
+ PendInfo.componentType = namedtype.NamedTypes(
96
+ namedtype.NamedType('pendToken', univ.OctetString()),
97
+ namedtype.NamedType('pendTime', useful.GeneralizedTime())
98
+ )
99
+
100
+ bodyIdMax = univ.Integer(4294967295)
101
+
102
+
103
+ class BodyPartID(univ.Integer):
104
+ pass
105
+
106
+
107
+ BodyPartID.subtypeSpec = constraint.ValueRangeConstraint(0, bodyIdMax)
108
+
109
+
110
+ class BodyPartPath(univ.SequenceOf):
111
+ pass
112
+
113
+
114
+ BodyPartPath.componentType = BodyPartID()
115
+ BodyPartPath.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
116
+
117
+
118
+ class BodyPartReference(univ.Choice):
119
+ pass
120
+
121
+
122
+ BodyPartReference.componentType = namedtype.NamedTypes(
123
+ namedtype.NamedType('bodyPartID', BodyPartID()),
124
+ namedtype.NamedType('bodyPartPath', BodyPartPath())
125
+ )
126
+
127
+
128
+ class CMCFailInfo(univ.Integer):
129
+ pass
130
+
131
+
132
+ CMCFailInfo.namedValues = namedval.NamedValues(
133
+ ('badAlg', 0),
134
+ ('badMessageCheck', 1),
135
+ ('badRequest', 2),
136
+ ('badTime', 3),
137
+ ('badCertId', 4),
138
+ ('unsupportedExt', 5),
139
+ ('mustArchiveKeys', 6),
140
+ ('badIdentity', 7),
141
+ ('popRequired', 8),
142
+ ('popFailed', 9),
143
+ ('noKeyReuse', 10),
144
+ ('internalCAError', 11),
145
+ ('tryLater', 12),
146
+ ('authDataFail', 13)
147
+ )
148
+
149
+
150
+ class CMCStatusInfoV2(univ.Sequence):
151
+ pass
152
+
153
+
154
+ CMCStatusInfoV2.componentType = namedtype.NamedTypes(
155
+ namedtype.NamedType('cMCStatus', CMCStatus()),
156
+ namedtype.NamedType('bodyList', univ.SequenceOf(componentType=BodyPartReference())),
157
+ namedtype.OptionalNamedType('statusString', char.UTF8String()),
158
+ namedtype.OptionalNamedType(
159
+ 'otherInfo', univ.Choice(
160
+ componentType=namedtype.NamedTypes(
161
+ namedtype.NamedType('failInfo', CMCFailInfo()),
162
+ namedtype.NamedType('pendInfo', PendInfo()),
163
+ namedtype.NamedType(
164
+ 'extendedFailInfo', univ.Sequence(
165
+ componentType=namedtype.NamedTypes(
166
+ namedtype.NamedType('failInfoOID', univ.ObjectIdentifier()),
167
+ namedtype.NamedType('failInfoValue', AttributeValue()))
168
+ ).subtype(implicitTag=tag.Tag(
169
+ tag.tagClassContext, tag.tagFormatConstructed, 1))
170
+ )
171
+ )
172
+ )
173
+ )
174
+ )
175
+
176
+
177
+ class GetCRL(univ.Sequence):
178
+ pass
179
+
180
+
181
+ GetCRL.componentType = namedtype.NamedTypes(
182
+ namedtype.NamedType('issuerName', rfc5280.Name()),
183
+ namedtype.OptionalNamedType('cRLName', rfc5280.GeneralName()),
184
+ namedtype.OptionalNamedType('time', useful.GeneralizedTime()),
185
+ namedtype.OptionalNamedType('reasons', rfc5280.ReasonFlags())
186
+ )
187
+
188
+ id_pkix = _buildOid(1, 3, 6, 1, 5, 5, 7)
189
+
190
+ id_cmc = _buildOid(id_pkix, 7)
191
+
192
+ id_cmc_batchResponses = _buildOid(id_cmc, 29)
193
+
194
+ id_cmc_popLinkWitness = _buildOid(id_cmc, 23)
195
+
196
+
197
+ class PopLinkWitnessV2(univ.Sequence):
198
+ pass
199
+
200
+
201
+ PopLinkWitnessV2.componentType = namedtype.NamedTypes(
202
+ namedtype.NamedType('keyGenAlgorithm', rfc5280.AlgorithmIdentifier()),
203
+ namedtype.NamedType('macAlgorithm', rfc5280.AlgorithmIdentifier()),
204
+ namedtype.NamedType('witness', univ.OctetString())
205
+ )
206
+
207
+ id_cmc_popLinkWitnessV2 = _buildOid(id_cmc, 33)
208
+
209
+ id_cmc_identityProofV2 = _buildOid(id_cmc, 34)
210
+
211
+ id_cmc_revokeRequest = _buildOid(id_cmc, 17)
212
+
213
+ id_cmc_recipientNonce = _buildOid(id_cmc, 7)
214
+
215
+
216
+ class ControlsProcessed(univ.Sequence):
217
+ pass
218
+
219
+
220
+ ControlsProcessed.componentType = namedtype.NamedTypes(
221
+ namedtype.NamedType('bodyList', univ.SequenceOf(componentType=BodyPartReference()))
222
+ )
223
+
224
+
225
+ class CertificationRequest(univ.Sequence):
226
+ pass
227
+
228
+
229
+ CertificationRequest.componentType = namedtype.NamedTypes(
230
+ namedtype.NamedType(
231
+ 'certificationRequestInfo', univ.Sequence(
232
+ componentType=namedtype.NamedTypes(
233
+ namedtype.NamedType('version', univ.Integer()),
234
+ namedtype.NamedType('subject', rfc5280.Name()),
235
+ namedtype.NamedType(
236
+ 'subjectPublicKeyInfo', univ.Sequence(
237
+ componentType=namedtype.NamedTypes(
238
+ namedtype.NamedType('algorithm', rfc5280.AlgorithmIdentifier()),
239
+ namedtype.NamedType('subjectPublicKey', univ.BitString())
240
+ )
241
+ )
242
+ ),
243
+ namedtype.NamedType(
244
+ 'attributes', univ.SetOf(
245
+ componentType=rfc5652.Attribute()).subtype(
246
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))
247
+ )
248
+ )
249
+ )
250
+ ),
251
+ namedtype.NamedType('signatureAlgorithm', rfc5280.AlgorithmIdentifier()),
252
+ namedtype.NamedType('signature', univ.BitString())
253
+ )
254
+
255
+
256
+ class TaggedCertificationRequest(univ.Sequence):
257
+ pass
258
+
259
+
260
+ TaggedCertificationRequest.componentType = namedtype.NamedTypes(
261
+ namedtype.NamedType('bodyPartID', BodyPartID()),
262
+ namedtype.NamedType('certificationRequest', CertificationRequest())
263
+ )
264
+
265
+
266
+ class TaggedRequest(univ.Choice):
267
+ pass
268
+
269
+
270
+ TaggedRequest.componentType = namedtype.NamedTypes(
271
+ namedtype.NamedType('tcr', TaggedCertificationRequest().subtype(
272
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0))),
273
+ namedtype.NamedType('crm',
274
+ rfc4211.CertReqMsg().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
275
+ namedtype.NamedType('orm', univ.Sequence(componentType=namedtype.NamedTypes(
276
+ namedtype.NamedType('bodyPartID', BodyPartID()),
277
+ namedtype.NamedType('requestMessageType', univ.ObjectIdentifier()),
278
+ namedtype.NamedType('requestMessageValue', univ.Any())
279
+ ))
280
+ .subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 2)))
281
+ )
282
+
283
+ id_cmc_popLinkRandom = _buildOid(id_cmc, 22)
284
+
285
+ id_cmc_statusInfo = _buildOid(id_cmc, 1)
286
+
287
+ id_cmc_trustedAnchors = _buildOid(id_cmc, 26)
288
+
289
+ id_cmc_transactionId = _buildOid(id_cmc, 5)
290
+
291
+ id_cmc_encryptedPOP = _buildOid(id_cmc, 9)
292
+
293
+
294
+ class PublishTrustAnchors(univ.Sequence):
295
+ pass
296
+
297
+
298
+ PublishTrustAnchors.componentType = namedtype.NamedTypes(
299
+ namedtype.NamedType('seqNumber', univ.Integer()),
300
+ namedtype.NamedType('hashAlgorithm', rfc5280.AlgorithmIdentifier()),
301
+ namedtype.NamedType('anchorHashes', univ.SequenceOf(componentType=univ.OctetString()))
302
+ )
303
+
304
+
305
+ class RevokeRequest(univ.Sequence):
306
+ pass
307
+
308
+
309
+ RevokeRequest.componentType = namedtype.NamedTypes(
310
+ namedtype.NamedType('issuerName', rfc5280.Name()),
311
+ namedtype.NamedType('serialNumber', univ.Integer()),
312
+ namedtype.NamedType('reason', rfc5280.CRLReason()),
313
+ namedtype.OptionalNamedType('invalidityDate', useful.GeneralizedTime()),
314
+ namedtype.OptionalNamedType('passphrase', univ.OctetString()),
315
+ namedtype.OptionalNamedType('comment', char.UTF8String())
316
+ )
317
+
318
+ id_cmc_senderNonce = _buildOid(id_cmc, 6)
319
+
320
+ id_cmc_authData = _buildOid(id_cmc, 27)
321
+
322
+
323
+ class TaggedContentInfo(univ.Sequence):
324
+ pass
325
+
326
+
327
+ TaggedContentInfo.componentType = namedtype.NamedTypes(
328
+ namedtype.NamedType('bodyPartID', BodyPartID()),
329
+ namedtype.NamedType('contentInfo', rfc5652.ContentInfo())
330
+ )
331
+
332
+
333
+ class IdentifyProofV2(univ.Sequence):
334
+ pass
335
+
336
+
337
+ IdentifyProofV2.componentType = namedtype.NamedTypes(
338
+ namedtype.NamedType('proofAlgID', rfc5280.AlgorithmIdentifier()),
339
+ namedtype.NamedType('macAlgId', rfc5280.AlgorithmIdentifier()),
340
+ namedtype.NamedType('witness', univ.OctetString())
341
+ )
342
+
343
+
344
+ class CMCPublicationInfo(univ.Sequence):
345
+ pass
346
+
347
+
348
+ CMCPublicationInfo.componentType = namedtype.NamedTypes(
349
+ namedtype.NamedType('hashAlg', rfc5280.AlgorithmIdentifier()),
350
+ namedtype.NamedType('certHashes', univ.SequenceOf(componentType=univ.OctetString())),
351
+ namedtype.NamedType('pubInfo', rfc4211.PKIPublicationInfo())
352
+ )
353
+
354
+ id_kp_cmcCA = _buildOid(rfc5280.id_kp, 27)
355
+
356
+ id_cmc_confirmCertAcceptance = _buildOid(id_cmc, 24)
357
+
358
+ id_cmc_raIdentityWitness = _buildOid(id_cmc, 35)
359
+
360
+ id_ExtensionReq = _buildOid(1, 2, 840, 113549, 1, 9, 14)
361
+
362
+ id_cct = _buildOid(id_pkix, 12)
363
+
364
+ id_cct_PKIData = _buildOid(id_cct, 2)
365
+
366
+ id_kp_cmcRA = _buildOid(rfc5280.id_kp, 28)
367
+
368
+
369
+ class CMCStatusInfo(univ.Sequence):
370
+ pass
371
+
372
+
373
+ CMCStatusInfo.componentType = namedtype.NamedTypes(
374
+ namedtype.NamedType('cMCStatus', CMCStatus()),
375
+ namedtype.NamedType('bodyList', univ.SequenceOf(componentType=BodyPartID())),
376
+ namedtype.OptionalNamedType('statusString', char.UTF8String()),
377
+ namedtype.OptionalNamedType(
378
+ 'otherInfo', univ.Choice(
379
+ componentType=namedtype.NamedTypes(
380
+ namedtype.NamedType('failInfo', CMCFailInfo()),
381
+ namedtype.NamedType('pendInfo', PendInfo())
382
+ )
383
+ )
384
+ )
385
+ )
386
+
387
+
388
+ class DecryptedPOP(univ.Sequence):
389
+ pass
390
+
391
+
392
+ DecryptedPOP.componentType = namedtype.NamedTypes(
393
+ namedtype.NamedType('bodyPartID', BodyPartID()),
394
+ namedtype.NamedType('thePOPAlgID', rfc5280.AlgorithmIdentifier()),
395
+ namedtype.NamedType('thePOP', univ.OctetString())
396
+ )
397
+
398
+ id_cmc_addExtensions = _buildOid(id_cmc, 8)
399
+
400
+ id_cmc_modCertTemplate = _buildOid(id_cmc, 31)
401
+
402
+
403
+ class TaggedAttribute(univ.Sequence):
404
+ pass
405
+
406
+
407
+ TaggedAttribute.componentType = namedtype.NamedTypes(
408
+ namedtype.NamedType('bodyPartID', BodyPartID()),
409
+ namedtype.NamedType('attrType', univ.ObjectIdentifier()),
410
+ namedtype.NamedType('attrValues', univ.SetOf(componentType=AttributeValue()),
411
+ openType=opentype.OpenType('attrType', cmcControlAttributesMap)
412
+ )
413
+ )
414
+
415
+
416
+ class OtherMsg(univ.Sequence):
417
+ pass
418
+
419
+
420
+ OtherMsg.componentType = namedtype.NamedTypes(
421
+ namedtype.NamedType('bodyPartID', BodyPartID()),
422
+ namedtype.NamedType('otherMsgType', univ.ObjectIdentifier()),
423
+ namedtype.NamedType('otherMsgValue', univ.Any())
424
+ )
425
+
426
+
427
+ class PKIData(univ.Sequence):
428
+ pass
429
+
430
+
431
+ PKIData.componentType = namedtype.NamedTypes(
432
+ namedtype.NamedType('controlSequence', univ.SequenceOf(componentType=TaggedAttribute())),
433
+ namedtype.NamedType('reqSequence', univ.SequenceOf(componentType=TaggedRequest())),
434
+ namedtype.NamedType('cmsSequence', univ.SequenceOf(componentType=TaggedContentInfo())),
435
+ namedtype.NamedType('otherMsgSequence', univ.SequenceOf(componentType=OtherMsg()))
436
+ )
437
+
438
+
439
+ class BodyPartList(univ.SequenceOf):
440
+ pass
441
+
442
+
443
+ BodyPartList.componentType = BodyPartID()
444
+ BodyPartList.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
445
+
446
+ id_cmc_responseBody = _buildOid(id_cmc, 37)
447
+
448
+
449
+ class AuthPublish(BodyPartID):
450
+ pass
451
+
452
+
453
+ class CMCUnsignedData(univ.Sequence):
454
+ pass
455
+
456
+
457
+ CMCUnsignedData.componentType = namedtype.NamedTypes(
458
+ namedtype.NamedType('bodyPartPath', BodyPartPath()),
459
+ namedtype.NamedType('identifier', univ.ObjectIdentifier()),
460
+ namedtype.NamedType('content', univ.Any())
461
+ )
462
+
463
+
464
+ class CMCCertId(rfc5652.IssuerAndSerialNumber):
465
+ pass
466
+
467
+
468
+ class PKIResponse(univ.Sequence):
469
+ pass
470
+
471
+
472
+ PKIResponse.componentType = namedtype.NamedTypes(
473
+ namedtype.NamedType('controlSequence', univ.SequenceOf(componentType=TaggedAttribute())),
474
+ namedtype.NamedType('cmsSequence', univ.SequenceOf(componentType=TaggedContentInfo())),
475
+ namedtype.NamedType('otherMsgSequence', univ.SequenceOf(componentType=OtherMsg()))
476
+ )
477
+
478
+
479
+ class ResponseBody(PKIResponse):
480
+ pass
481
+
482
+
483
+ id_cmc_statusInfoV2 = _buildOid(id_cmc, 25)
484
+
485
+ id_cmc_lraPOPWitness = _buildOid(id_cmc, 11)
486
+
487
+
488
+ class ModCertTemplate(univ.Sequence):
489
+ pass
490
+
491
+
492
+ ModCertTemplate.componentType = namedtype.NamedTypes(
493
+ namedtype.NamedType('pkiDataReference', BodyPartPath()),
494
+ namedtype.NamedType('certReferences', BodyPartList()),
495
+ namedtype.DefaultedNamedType('replace', univ.Boolean().subtype(value=1)),
496
+ namedtype.NamedType('certTemplate', rfc4211.CertTemplate())
497
+ )
498
+
499
+ id_cmc_regInfo = _buildOid(id_cmc, 18)
500
+
501
+ id_cmc_identityProof = _buildOid(id_cmc, 3)
502
+
503
+
504
+ class ExtensionReq(univ.SequenceOf):
505
+ pass
506
+
507
+
508
+ ExtensionReq.componentType = rfc5280.Extension()
509
+ ExtensionReq.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
510
+
511
+ # https://www.rfc-editor.org/errata/eid5931
512
+ id_kp_cmcArchive = _buildOid(rfc5280.id_kp, 29)
513
+
514
+ id_cmc_publishCert = _buildOid(id_cmc, 30)
515
+
516
+ id_cmc_dataReturn = _buildOid(id_cmc, 4)
517
+
518
+
519
+ class LraPopWitness(univ.Sequence):
520
+ pass
521
+
522
+
523
+ LraPopWitness.componentType = namedtype.NamedTypes(
524
+ namedtype.NamedType('pkiDataBodyid', BodyPartID()),
525
+ namedtype.NamedType('bodyIds', univ.SequenceOf(componentType=BodyPartID()))
526
+ )
527
+
528
+ id_aa = _buildOid(1, 2, 840, 113549, 1, 9, 16, 2)
529
+
530
+ id_aa_cmc_unsignedData = _buildOid(id_aa, 34)
531
+
532
+ id_cmc_getCert = _buildOid(id_cmc, 15)
533
+
534
+ id_cmc_batchRequests = _buildOid(id_cmc, 28)
535
+
536
+ id_cmc_decryptedPOP = _buildOid(id_cmc, 10)
537
+
538
+ id_cmc_responseInfo = _buildOid(id_cmc, 19)
539
+
540
+ id_cmc_changeSubjectName = _buildOid(id_cmc, 36)
541
+
542
+
543
+ class GetCert(univ.Sequence):
544
+ pass
545
+
546
+
547
+ GetCert.componentType = namedtype.NamedTypes(
548
+ namedtype.NamedType('issuerName', rfc5280.GeneralName()),
549
+ namedtype.NamedType('serialNumber', univ.Integer())
550
+ )
551
+
552
+ id_cmc_identification = _buildOid(id_cmc, 2)
553
+
554
+ id_cmc_queryPending = _buildOid(id_cmc, 21)
555
+
556
+
557
+ class AddExtensions(univ.Sequence):
558
+ pass
559
+
560
+
561
+ AddExtensions.componentType = namedtype.NamedTypes(
562
+ namedtype.NamedType('pkiDataReference', BodyPartID()),
563
+ namedtype.NamedType('certReferences', univ.SequenceOf(componentType=BodyPartID())),
564
+ namedtype.NamedType('extensions', univ.SequenceOf(componentType=rfc5280.Extension()))
565
+ )
566
+
567
+
568
+ class EncryptedPOP(univ.Sequence):
569
+ pass
570
+
571
+
572
+ EncryptedPOP.componentType = namedtype.NamedTypes(
573
+ namedtype.NamedType('request', TaggedRequest()),
574
+ namedtype.NamedType('cms', rfc5652.ContentInfo()),
575
+ namedtype.NamedType('thePOPAlgID', rfc5280.AlgorithmIdentifier()),
576
+ namedtype.NamedType('witnessAlgID', rfc5280.AlgorithmIdentifier()),
577
+ namedtype.NamedType('witness', univ.OctetString())
578
+ )
579
+
580
+ id_cmc_getCRL = _buildOid(id_cmc, 16)
581
+
582
+ id_cct_PKIResponse = _buildOid(id_cct, 3)
583
+
584
+ id_cmc_controlProcessed = _buildOid(id_cmc, 32)
585
+
586
+
587
+ class NoSignatureValue(univ.OctetString):
588
+ pass
589
+
590
+
591
+ id_ad_cmc = _buildOid(rfc5280.id_ad, 12)
592
+
593
+ id_alg_noSignature = _buildOid(id_pkix, 6, 2)
594
+
595
+
596
+ # Update the CMC Control Attributes Map (a.k.a. CMS Attributes Map)
597
+
598
+ _cmcControlAttributesMapUpdate = {
599
+ id_cmc_statusInfo: CMCStatusInfo(),
600
+ id_cmc_statusInfoV2: CMCStatusInfoV2(),
601
+ id_cmc_identification: char.UTF8String(),
602
+ id_cmc_identityProof: univ.OctetString(),
603
+ id_cmc_identityProofV2: IdentifyProofV2(),
604
+ id_cmc_dataReturn: univ.OctetString(),
605
+ id_cmc_transactionId: univ.Integer(),
606
+ id_cmc_senderNonce: univ.OctetString(),
607
+ id_cmc_recipientNonce: univ.OctetString(),
608
+ id_cmc_addExtensions: AddExtensions(),
609
+ id_cmc_encryptedPOP: EncryptedPOP(),
610
+ id_cmc_decryptedPOP: DecryptedPOP(),
611
+ id_cmc_lraPOPWitness: LraPopWitness(),
612
+ id_cmc_getCert: GetCert(),
613
+ id_cmc_getCRL: GetCRL(),
614
+ id_cmc_revokeRequest: RevokeRequest(),
615
+ id_cmc_regInfo: univ.OctetString(),
616
+ id_cmc_responseInfo: univ.OctetString(),
617
+ id_cmc_queryPending: univ.OctetString(),
618
+ id_cmc_popLinkRandom: univ.OctetString(),
619
+ id_cmc_popLinkWitness: univ.OctetString(),
620
+ id_cmc_popLinkWitnessV2: PopLinkWitnessV2(),
621
+ id_cmc_confirmCertAcceptance: CMCCertId(),
622
+ id_cmc_trustedAnchors: PublishTrustAnchors(),
623
+ id_cmc_authData: AuthPublish(),
624
+ id_cmc_batchRequests: BodyPartList(),
625
+ id_cmc_batchResponses: BodyPartList(),
626
+ id_cmc_publishCert: CMCPublicationInfo(),
627
+ id_cmc_modCertTemplate: ModCertTemplate(),
628
+ id_cmc_controlProcessed: ControlsProcessed(),
629
+ id_ExtensionReq: ExtensionReq(),
630
+ }
631
+
632
+ cmcControlAttributesMap.update(_cmcControlAttributesMapUpdate)
633
+
634
+
635
+ #Update the CMS Content Type Map
636
+
637
+ _cmsContentTypesMapUpdate = {
638
+ id_cct_PKIData: PKIData(),
639
+ id_cct_PKIResponse: PKIResponse(),
640
+ }
641
+
642
+ cmsContentTypesMap.update(_cmsContentTypesMapUpdate)
643
+