pyasn1-alt-modules 0.4.2__py2.py3-none-any.whl → 0.4.4__py2.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 (192) hide show
  1. pyasn1_alt_modules/__init__.py +1 -1
  2. pyasn1_alt_modules/opentypemap.py +1 -1
  3. pyasn1_alt_modules/pem.py +1 -1
  4. pyasn1_alt_modules/rfc1155.py +1 -1
  5. pyasn1_alt_modules/rfc1157.py +1 -1
  6. pyasn1_alt_modules/rfc1901.py +1 -1
  7. pyasn1_alt_modules/rfc1902.py +1 -1
  8. pyasn1_alt_modules/rfc1905.py +1 -1
  9. pyasn1_alt_modules/rfc2040.py +1 -1
  10. pyasn1_alt_modules/rfc2251.py +1 -1
  11. pyasn1_alt_modules/rfc2314.py +1 -1
  12. pyasn1_alt_modules/rfc2315.py +1 -1
  13. pyasn1_alt_modules/rfc2437.py +1 -1
  14. pyasn1_alt_modules/rfc2459.py +1 -1
  15. pyasn1_alt_modules/rfc2511.py +1 -1
  16. pyasn1_alt_modules/rfc2528.py +1 -1
  17. pyasn1_alt_modules/rfc2560.py +1 -1
  18. pyasn1_alt_modules/rfc2631.py +1 -1
  19. pyasn1_alt_modules/rfc2634.py +1 -1
  20. pyasn1_alt_modules/rfc2743.py +1 -1
  21. pyasn1_alt_modules/rfc2876.py +1 -1
  22. pyasn1_alt_modules/rfc2898.py +1 -1
  23. pyasn1_alt_modules/rfc2985.py +1 -1
  24. pyasn1_alt_modules/rfc2986.py +1 -1
  25. pyasn1_alt_modules/rfc3058.py +1 -1
  26. pyasn1_alt_modules/rfc3114.py +1 -1
  27. pyasn1_alt_modules/rfc3125.py +1 -1
  28. pyasn1_alt_modules/rfc3161.py +1 -1
  29. pyasn1_alt_modules/rfc3217.py +1 -1
  30. pyasn1_alt_modules/rfc3274.py +1 -1
  31. pyasn1_alt_modules/rfc3279.py +1 -1
  32. pyasn1_alt_modules/rfc3280.py +1 -1
  33. pyasn1_alt_modules/rfc3281.py +1 -1
  34. pyasn1_alt_modules/rfc3370.py +1 -1
  35. pyasn1_alt_modules/rfc3412.py +1 -1
  36. pyasn1_alt_modules/rfc3414.py +1 -1
  37. pyasn1_alt_modules/rfc3447.py +1 -1
  38. pyasn1_alt_modules/rfc3537.py +1 -1
  39. pyasn1_alt_modules/rfc3546.py +23 -0
  40. pyasn1_alt_modules/rfc3560.py +1 -1
  41. pyasn1_alt_modules/rfc3565.py +1 -1
  42. pyasn1_alt_modules/rfc3657.py +1 -1
  43. pyasn1_alt_modules/rfc3709.py +1 -1
  44. pyasn1_alt_modules/rfc3739.py +6 -3
  45. pyasn1_alt_modules/rfc3770.py +1 -1
  46. pyasn1_alt_modules/rfc3779.py +1 -1
  47. pyasn1_alt_modules/rfc3820.py +1 -1
  48. pyasn1_alt_modules/rfc3852.py +1 -1
  49. pyasn1_alt_modules/rfc3874.py +1 -1
  50. pyasn1_alt_modules/rfc4010.py +1 -1
  51. pyasn1_alt_modules/rfc4043.py +1 -1
  52. pyasn1_alt_modules/rfc4055.py +1 -1
  53. pyasn1_alt_modules/rfc4056.py +1 -1
  54. pyasn1_alt_modules/rfc4059.py +1 -1
  55. pyasn1_alt_modules/rfc4073.py +1 -1
  56. pyasn1_alt_modules/rfc4108.py +1 -1
  57. pyasn1_alt_modules/rfc4210.py +1 -1
  58. pyasn1_alt_modules/rfc4211.py +1 -1
  59. pyasn1_alt_modules/rfc4231.py +1 -1
  60. pyasn1_alt_modules/rfc4262.py +1 -1
  61. pyasn1_alt_modules/rfc4334.py +1 -1
  62. pyasn1_alt_modules/rfc4357.py +1 -1
  63. pyasn1_alt_modules/rfc4366.py +23 -0
  64. pyasn1_alt_modules/rfc4387.py +1 -1
  65. pyasn1_alt_modules/rfc4476.py +1 -1
  66. pyasn1_alt_modules/rfc4490.py +1 -1
  67. pyasn1_alt_modules/rfc4491.py +1 -1
  68. pyasn1_alt_modules/rfc4683.py +1 -1
  69. pyasn1_alt_modules/rfc4985.py +1 -1
  70. pyasn1_alt_modules/rfc4998.py +1 -1
  71. pyasn1_alt_modules/rfc5035.py +1 -1
  72. pyasn1_alt_modules/rfc5055.py +1 -1
  73. pyasn1_alt_modules/rfc5083.py +1 -1
  74. pyasn1_alt_modules/rfc5084.py +1 -1
  75. pyasn1_alt_modules/rfc5126.py +1 -1
  76. pyasn1_alt_modules/rfc5208.py +1 -1
  77. pyasn1_alt_modules/rfc5275.py +1 -1
  78. pyasn1_alt_modules/rfc5276.py +1 -1
  79. pyasn1_alt_modules/rfc5280.py +3 -2
  80. pyasn1_alt_modules/rfc5480.py +1 -1
  81. pyasn1_alt_modules/rfc5544.py +1 -1
  82. pyasn1_alt_modules/rfc5636.py +1 -1
  83. pyasn1_alt_modules/rfc5639.py +1 -1
  84. pyasn1_alt_modules/rfc5649.py +1 -1
  85. pyasn1_alt_modules/rfc5652.py +1 -1
  86. pyasn1_alt_modules/rfc5697.py +1 -1
  87. pyasn1_alt_modules/rfc5698.py +1 -1
  88. pyasn1_alt_modules/rfc5751.py +1 -1
  89. pyasn1_alt_modules/rfc5752.py +1 -1
  90. pyasn1_alt_modules/rfc5753.py +1 -1
  91. pyasn1_alt_modules/rfc5755.py +1 -1
  92. pyasn1_alt_modules/rfc5913.py +1 -1
  93. pyasn1_alt_modules/rfc5914.py +1 -1
  94. pyasn1_alt_modules/rfc5915.py +1 -1
  95. pyasn1_alt_modules/rfc5916.py +1 -1
  96. pyasn1_alt_modules/rfc5917.py +1 -1
  97. pyasn1_alt_modules/rfc5924.py +1 -1
  98. pyasn1_alt_modules/rfc5934.py +1 -1
  99. pyasn1_alt_modules/rfc5940.py +1 -1
  100. pyasn1_alt_modules/rfc5958.py +1 -1
  101. pyasn1_alt_modules/rfc5990.py +1 -1
  102. pyasn1_alt_modules/rfc6010.py +1 -1
  103. pyasn1_alt_modules/rfc6019.py +1 -1
  104. pyasn1_alt_modules/rfc6031.py +1 -1
  105. pyasn1_alt_modules/rfc6032.py +1 -1
  106. pyasn1_alt_modules/rfc6066.py +1 -1
  107. pyasn1_alt_modules/rfc6120.py +1 -1
  108. pyasn1_alt_modules/rfc6170.py +1 -1
  109. pyasn1_alt_modules/rfc6187.py +1 -1
  110. pyasn1_alt_modules/rfc6210.py +1 -1
  111. pyasn1_alt_modules/rfc6211.py +1 -1
  112. pyasn1_alt_modules/rfc6402.py +1 -1
  113. pyasn1_alt_modules/rfc6482.py +1 -1
  114. pyasn1_alt_modules/rfc6484.py +1 -1
  115. pyasn1_alt_modules/rfc6486.py +1 -1
  116. pyasn1_alt_modules/rfc6487.py +1 -1
  117. pyasn1_alt_modules/rfc6492.py +1 -1
  118. pyasn1_alt_modules/rfc6493.py +1 -1
  119. pyasn1_alt_modules/rfc6494.py +1 -1
  120. pyasn1_alt_modules/rfc6664.py +1 -1
  121. pyasn1_alt_modules/rfc6955.py +1 -1
  122. pyasn1_alt_modules/rfc6960.py +1 -1
  123. pyasn1_alt_modules/rfc6962.py +1 -1
  124. pyasn1_alt_modules/rfc7030.py +1 -1
  125. pyasn1_alt_modules/rfc7191.py +1 -1
  126. pyasn1_alt_modules/rfc7229.py +1 -1
  127. pyasn1_alt_modules/rfc7292.py +1 -1
  128. pyasn1_alt_modules/rfc7296.py +1 -1
  129. pyasn1_alt_modules/rfc7508.py +1 -1
  130. pyasn1_alt_modules/rfc7585.py +1 -1
  131. pyasn1_alt_modules/rfc7633.py +1 -1
  132. pyasn1_alt_modules/rfc7693.py +1 -1
  133. pyasn1_alt_modules/rfc7773.py +1 -1
  134. pyasn1_alt_modules/rfc7836.py +1 -1
  135. pyasn1_alt_modules/rfc7894.py +1 -1
  136. pyasn1_alt_modules/rfc7906.py +1 -1
  137. pyasn1_alt_modules/rfc7914.py +1 -1
  138. pyasn1_alt_modules/rfc8017.py +1 -1
  139. pyasn1_alt_modules/rfc8018.py +1 -1
  140. pyasn1_alt_modules/rfc8103.py +1 -1
  141. pyasn1_alt_modules/rfc8209.py +1 -1
  142. pyasn1_alt_modules/rfc8226.py +1 -1
  143. pyasn1_alt_modules/rfc8358.py +1 -1
  144. pyasn1_alt_modules/rfc8360.py +1 -1
  145. pyasn1_alt_modules/rfc8398.py +1 -1
  146. pyasn1_alt_modules/rfc8410.py +1 -1
  147. pyasn1_alt_modules/rfc8418.py +1 -1
  148. pyasn1_alt_modules/rfc8419.py +1 -1
  149. pyasn1_alt_modules/rfc8479.py +1 -1
  150. pyasn1_alt_modules/rfc8494.py +1 -1
  151. pyasn1_alt_modules/rfc8520.py +1 -1
  152. pyasn1_alt_modules/rfc8619.py +1 -1
  153. pyasn1_alt_modules/rfc8649.py +1 -1
  154. pyasn1_alt_modules/rfc8692.py +1 -1
  155. pyasn1_alt_modules/rfc8696.py +1 -1
  156. pyasn1_alt_modules/rfc8702.py +1 -1
  157. pyasn1_alt_modules/rfc8708.py +1 -1
  158. pyasn1_alt_modules/rfc8737.py +1 -1
  159. pyasn1_alt_modules/rfc8769.py +1 -1
  160. pyasn1_alt_modules/rfc8894.py +1 -1
  161. pyasn1_alt_modules/rfc8951.py +1 -1
  162. pyasn1_alt_modules/rfc8954.py +238 -0
  163. pyasn1_alt_modules/rfc8994.py +1 -1
  164. pyasn1_alt_modules/rfc8995.py +1 -1
  165. pyasn1_alt_modules/rfc9044.py +1 -1
  166. pyasn1_alt_modules/rfc9092.py +1 -1
  167. pyasn1_alt_modules/rfc9118.py +1 -1
  168. pyasn1_alt_modules/rfc9174.py +1 -1
  169. pyasn1_alt_modules/rfc9189.py +1 -1
  170. pyasn1_alt_modules/rfc9215.py +11 -1
  171. pyasn1_alt_modules/rfc9286.py +1 -1
  172. pyasn1_alt_modules/rfc9289.py +1 -1
  173. pyasn1_alt_modules/rfc9310.py +1 -1
  174. pyasn1_alt_modules/rfc9323.py +1 -1
  175. pyasn1_alt_modules/rfc9336.py +1 -1
  176. pyasn1_alt_modules/rfc9337.py +1 -1
  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 +717 -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-0.4.2.dist-info → pyasn1_alt_modules-0.4.4.dist-info}/LICENSE.txt +1 -1
  185. {pyasn1_alt_modules-0.4.2.dist-info → pyasn1_alt_modules-0.4.4.dist-info}/METADATA +7 -7
  186. pyasn1_alt_modules-0.4.4.dist-info/RECORD +189 -0
  187. {pyasn1_alt_modules-0.4.2.dist-info → pyasn1_alt_modules-0.4.4.dist-info}/WHEEL +1 -1
  188. pyasn1_alt_modules/addon.py +0 -284
  189. pyasn1_alt_modules/rfc5794.py +0 -391
  190. pyasn1_alt_modules-0.4.2.dist-info/RECORD +0 -181
  191. {pyasn1_alt_modules-0.4.2.dist-info → pyasn1_alt_modules-0.4.4.dist-info}/top_level.txt +0 -0
  192. {pyasn1_alt_modules-0.4.2.dist-info → pyasn1_alt_modules-0.4.4.dist-info}/zip-safe +0 -0
@@ -0,0 +1,717 @@
1
+ #
2
+ # This file is part of pyasn1_alt_modules software.
3
+ #
4
+ # Created by Russ Housley with minor assistance from asn1ate v.0.6.0.
5
+ # Modified by Russ Housley to make InfoTypeAndValue['infoType'] optional.
6
+ #
7
+ # Copyright (c) 2021, Vigil Security, LLC
8
+ # License: http://vigilsec.com/pyasn1_alt_modules_license.txt
9
+ #
10
+ # Updates to the Certificate Management Protocol (CMP)
11
+ #
12
+ # ASN.1 source from:
13
+ # https://www.rfc_editor.org/rfc/rfc9480.txt
14
+ #
15
+
16
+ from pyasn1.type import char
17
+ from pyasn1.type import constraint
18
+ from pyasn1.type import namedval
19
+ from pyasn1.type import namedtype
20
+ from pyasn1.type import opentype
21
+ from pyasn1.type import tag
22
+ from pyasn1.type import univ
23
+ from pyasn1.type import useful
24
+
25
+ from pyasn1_alt_modules import rfc2985
26
+ from pyasn1_alt_modules import rfc4210
27
+ from pyasn1_alt_modules import rfc4211
28
+ from pyasn1_alt_modules import rfc5280
29
+ from pyasn1_alt_modules import rfc5652
30
+ from pyasn1_alt_modules import rfc6402
31
+ from pyasn1_alt_modules import opentypemap
32
+
33
+ cmpInfoTypeAndValueMap = opentypemap.get('cmpInfoTypeAndValueMap')
34
+
35
+ cmsAttributesMap = opentypemap.get('cmsAttributesMap')
36
+
37
+ MAX = float('inf')
38
+
39
+
40
+ # Imports from RFC 5280
41
+
42
+ Certificate = rfc5280.Certificate
43
+
44
+ CertificateList = rfc5280.CertificateList
45
+
46
+ DistributionPointName = rfc5280.DistributionPointName
47
+
48
+ Extensions = rfc5280.Extensions
49
+
50
+ Name = rfc5280.Name
51
+
52
+ AlgorithmIdentifier = rfc5280.AlgorithmIdentifier
53
+
54
+ GeneralNames = rfc5280.GeneralNames
55
+
56
+ GeneralName = rfc5280.GeneralName
57
+
58
+ KeyIdentifier = rfc5280.KeyIdentifier
59
+
60
+ Time = rfc5280.Time
61
+
62
+ id_pkix = rfc5280.id_pkix
63
+
64
+ id_kp = rfc5280.id_kp
65
+
66
+
67
+ # Imports from RFC 4211
68
+
69
+ CertTemplate = rfc4211.CertTemplate
70
+
71
+ PKIPublicationInfo = rfc4211.PKIPublicationInfo
72
+
73
+ EncryptedKey = rfc4211.EncryptedKey
74
+
75
+ CertId = rfc4211.CertId
76
+
77
+ CertReqMessages = rfc4211.CertReqMessages
78
+
79
+ Controls = rfc4211.Controls
80
+
81
+ AttributeTypeAndValue = rfc4211.AttributeTypeAndValue
82
+
83
+ id_regCtrl = rfc4211.id_regCtrl
84
+
85
+
86
+ # Imports from RFC 5652
87
+
88
+ Attribute = rfc5652.Attribute
89
+
90
+ EnvelopedData = rfc5652.EnvelopedData
91
+
92
+ SignedData = rfc5652.SignedData
93
+
94
+
95
+ # Imports from RFC 6402
96
+
97
+ CertificationRequest = rfc6402.CertificationRequest
98
+
99
+ id_kp_cmcCA = rfc6402.id_kp_cmcCA
100
+
101
+ id_kp_cmcRA = rfc6402.id_kp_cmcRA
102
+
103
+
104
+ # Imports from RFC 2985
105
+
106
+ pkcs_9 = rfc2985.pkcs_9
107
+
108
+ pkcs_9_at_localKeyId = rfc2985.pkcs_9_at_localKeyId
109
+
110
+
111
+ # Updates to the Certificate Management Protocol (CMP)
112
+ # Where possible, just import from RFC 4210
113
+
114
+ CMPCertificate = rfc4210.CMPCertificate
115
+
116
+
117
+ OOBCert = rfc4210.OOBCert
118
+
119
+
120
+ CertAnnContent = rfc4210.CertAnnContent
121
+
122
+
123
+ KeyIdentifier = rfc4210.KeyIdentifier
124
+
125
+
126
+ PollRepContent = rfc4210.PollRepContent
127
+
128
+
129
+ PKIConfirmContent = rfc4210.PKIConfirmContent
130
+
131
+
132
+ CRLAnnContent = rfc4210.CRLAnnContent
133
+
134
+
135
+ CAKeyUpdAnnContent = rfc4210.CAKeyUpdAnnContent
136
+
137
+
138
+ RevDetails = rfc4210.RevDetails
139
+
140
+
141
+ RevReqContent = rfc4210.RevReqContent
142
+
143
+
144
+ class InfoTypeAndValue(univ.Sequence):
145
+ componentType = namedtype.NamedTypes(
146
+ namedtype.NamedType('infoType', univ.ObjectIdentifier()),
147
+ namedtype.OptionalNamedType('infoValue', univ.Any(),
148
+ openType=opentype.OpenType('infoType', cmpInfoTypeAndValueMap))
149
+ )
150
+
151
+
152
+ class GenRepContent(univ.SequenceOf):
153
+ componentType = InfoTypeAndValue()
154
+
155
+
156
+ class GenMsgContent(univ.SequenceOf):
157
+ componentType = InfoTypeAndValue()
158
+
159
+
160
+ class CertOrEncCert(univ.Choice):
161
+ componentType = namedtype.NamedTypes(
162
+ namedtype.NamedType('certificate', CMPCertificate().subtype(
163
+ explicitTag=tag.Tag(tag.tagClassContext,
164
+ tag.tagFormatConstructed, 0))),
165
+ namedtype.NamedType('encryptedCert', EncryptedKey().subtype(
166
+ explicitTag=tag.Tag(tag.tagClassContext,
167
+ tag.tagFormatSimple, 1)))
168
+ )
169
+
170
+
171
+ class CertifiedKeyPair(univ.Sequence):
172
+ componentType = namedtype.NamedTypes(
173
+ namedtype.NamedType('certOrEncCert', CertOrEncCert()),
174
+ namedtype.OptionalNamedType('privateKey',
175
+ EncryptedKey().subtype(explicitTag=tag.Tag(
176
+ tag.tagClassContext, tag.tagFormatSimple, 0))),
177
+ namedtype.OptionalNamedType('publicationInfo',
178
+ PKIPublicationInfo().subtype(explicitTag=tag.Tag(
179
+ tag.tagClassContext, tag.tagFormatSimple, 1)))
180
+ )
181
+
182
+
183
+ POPODecKeyRespContent = rfc4210.POPODecKeyRespContent
184
+
185
+
186
+ Challenge = rfc4210.Challenge
187
+
188
+
189
+ # Added in CMP Updates
190
+ #
191
+ class Rand(univ.Sequence):
192
+ componentType = namedtype.NamedTypes(
193
+ namedtype.NamedType('int', univ.Integer()),
194
+ namedtype.NamedType('sender', GeneralName())
195
+ )
196
+
197
+
198
+ PKIStatus = rfc4210.PKIStatus
199
+
200
+
201
+ PKIFailureInfo = rfc4210.PKIFailureInfo
202
+
203
+
204
+ RevAnnContent = rfc4210.RevAnnContent
205
+
206
+
207
+ RevRepContent = rfc4210.RevRepContent
208
+
209
+
210
+ KeyRecRepContent = rfc4210.KeyRecRepContent
211
+
212
+
213
+ CertResponse = rfc4210.CertResponse
214
+
215
+
216
+ CertRepMessage = rfc4210.CertRepMessage
217
+
218
+
219
+ POPODecKeyChallContent = rfc4210.POPODecKeyChallContent
220
+
221
+
222
+ OOBCertHash = rfc4210.OOBCertHash
223
+
224
+
225
+ DHBMParameter = rfc4210.DHBMParameter
226
+
227
+
228
+ PBMParameter = rfc4210.PBMParameter
229
+
230
+
231
+ PKIProtection = rfc4210.PKIProtection
232
+
233
+
234
+ class PKIFreeText(univ.SequenceOf):
235
+ componentType = char.UTF8String()
236
+ subtypeSpec = constraint.ValueSizeConstraint(1, MAX)
237
+
238
+
239
+ class PKIStatusInfo(univ.Sequence):
240
+ componentType = namedtype.NamedTypes(
241
+ namedtype.NamedType('status', PKIStatus()),
242
+ namedtype.OptionalNamedType('statusString', PKIFreeText()),
243
+ namedtype.OptionalNamedType('failInfo', PKIFailureInfo())
244
+ )
245
+
246
+
247
+ class ErrorMsgContent(univ.Sequence):
248
+ componentType = namedtype.NamedTypes(
249
+ namedtype.NamedType('pKIStatusInfo', PKIStatusInfo()),
250
+ namedtype.OptionalNamedType('errorCode', univ.Integer()),
251
+ namedtype.OptionalNamedType('errorDetails', PKIFreeText())
252
+ )
253
+
254
+
255
+ PollReqContent = rfc4210.PollReqContent
256
+
257
+
258
+ class PollRepContent(univ.SequenceOf):
259
+ componentType = univ.Sequence(componentType=namedtype.NamedTypes(
260
+ namedtype.NamedType('certReqId', univ.Integer()),
261
+ namedtype.NamedType('checkAfter', univ.Integer()),
262
+ namedtype.OptionalNamedType('reason', PKIFreeText())
263
+ ))
264
+
265
+
266
+ class CertStatus(univ.Sequence):
267
+ componentType = namedtype.NamedTypes(
268
+ namedtype.OptionalNamedType('hashAlg',
269
+ AlgorithmIdentifier().subtype(explicitTag=tag.Tag(
270
+ tag.tagClassContext, tag.tagFormatSimple, 0))),
271
+ namedtype.NamedType('certHash', univ.OctetString()),
272
+ namedtype.NamedType('certReqId', univ.Integer()),
273
+ namedtype.OptionalNamedType('statusInfo', PKIStatusInfo())
274
+ )
275
+
276
+
277
+ class CertConfirmContent(univ.SequenceOf):
278
+ componentType = CertStatus()
279
+
280
+
281
+ class PKIHeader(univ.Sequence):
282
+ componentType = namedtype.NamedTypes(
283
+ namedtype.NamedType('pvno', univ.Integer(
284
+ namedValues=namedval.NamedValues(
285
+ ('cmp1999', 1), ('cmp2000', 2), ('cmp2021', 3)))),
286
+ namedtype.NamedType('sender', GeneralName()),
287
+ namedtype.NamedType('recipient', GeneralName()),
288
+ namedtype.OptionalNamedType('messageTime',
289
+ useful.GeneralizedTime().subtype(explicitTag=tag.Tag(
290
+ tag.tagClassContext, tag.tagFormatSimple, 0))),
291
+ namedtype.OptionalNamedType('protectionAlg',
292
+ AlgorithmIdentifier().subtype(explicitTag=tag.Tag(
293
+ tag.tagClassContext, tag.tagFormatSimple, 1))),
294
+ namedtype.OptionalNamedType('senderKID',
295
+ KeyIdentifier().subtype(explicitTag=tag.Tag(
296
+ tag.tagClassContext, tag.tagFormatSimple, 2))),
297
+ namedtype.OptionalNamedType('recipKID',
298
+ KeyIdentifier().subtype(explicitTag=tag.Tag(
299
+ tag.tagClassContext, tag.tagFormatSimple, 3))),
300
+ namedtype.OptionalNamedType('transactionID',
301
+ univ.OctetString().subtype(explicitTag=tag.Tag(
302
+ tag.tagClassContext, tag.tagFormatSimple, 4))),
303
+ namedtype.OptionalNamedType('senderNonce',
304
+ univ.OctetString().subtype(explicitTag=tag.Tag(
305
+ tag.tagClassContext, tag.tagFormatSimple, 5))),
306
+ namedtype.OptionalNamedType('recipNonce',
307
+ univ.OctetString().subtype(explicitTag=tag.Tag(
308
+ tag.tagClassContext, tag.tagFormatSimple, 6))),
309
+ namedtype.OptionalNamedType('freeText',
310
+ PKIFreeText().subtype(explicitTag=tag.Tag(
311
+ tag.tagClassContext, tag.tagFormatSimple, 7))),
312
+ namedtype.OptionalNamedType('generalInfo',
313
+ univ.SequenceOf(componentType=InfoTypeAndValue()).subtype(
314
+ subtypeSpec=constraint.ValueSizeConstraint(1, MAX)).subtype(
315
+ explicitTag=tag.Tag(tag.tagClassContext,
316
+ tag.tagFormatSimple, 8)))
317
+ )
318
+
319
+
320
+ # Since pyasn1 does not naturally handle recursive definitions, this hack
321
+ # instead of:
322
+ # class NestedMessageContent(PKIMessages):
323
+ # pass
324
+ # Note that there is a second part of the hack at the bottom of the module.
325
+ #
326
+ class NestedMessageContent(univ.SequenceOf):
327
+ componentType = univ.Any()
328
+
329
+
330
+ nestedMessageContent = NestedMessageContent().subtype(
331
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 20))
332
+
333
+
334
+ class PKIBody(univ.Choice):
335
+ componentType = namedtype.NamedTypes(
336
+ namedtype.NamedType('ir', CertReqMessages().subtype(
337
+ explicitTag=tag.Tag(tag.tagClassContext,
338
+ tag.tagFormatSimple, 0))),
339
+ namedtype.NamedType('ip', CertRepMessage().subtype(
340
+ explicitTag=tag.Tag(tag.tagClassContext,
341
+ tag.tagFormatConstructed, 1))),
342
+ namedtype.NamedType('cr', CertReqMessages().subtype(
343
+ explicitTag=tag.Tag(tag.tagClassContext,
344
+ tag.tagFormatSimple, 2))),
345
+ namedtype.NamedType('cp', CertRepMessage().subtype(
346
+ explicitTag=tag.Tag(tag.tagClassContext,
347
+ tag.tagFormatConstructed, 3))),
348
+ namedtype.NamedType('p10cr', CertificationRequest().subtype(
349
+ explicitTag=tag.Tag(tag.tagClassContext,
350
+ tag.tagFormatSimple, 4))),
351
+ namedtype.NamedType('popdecc', POPODecKeyChallContent().subtype(
352
+ explicitTag=tag.Tag(tag.tagClassContext,
353
+ tag.tagFormatSimple, 5))),
354
+ namedtype.NamedType('popdecr', POPODecKeyRespContent().subtype(
355
+ explicitTag=tag.Tag(tag.tagClassContext,
356
+ tag.tagFormatSimple, 6))),
357
+ namedtype.NamedType('kur', CertReqMessages().subtype(
358
+ explicitTag=tag.Tag(tag.tagClassContext,
359
+ tag.tagFormatSimple, 7))),
360
+ namedtype.NamedType('kup', CertRepMessage().subtype(
361
+ explicitTag=tag.Tag(tag.tagClassContext,
362
+ tag.tagFormatConstructed, 8))),
363
+ namedtype.NamedType('krr', CertReqMessages().subtype(
364
+ explicitTag=tag.Tag(tag.tagClassContext,
365
+ tag.tagFormatSimple, 9))),
366
+ namedtype.NamedType('krp', KeyRecRepContent().subtype(
367
+ explicitTag=tag.Tag(tag.tagClassContext,
368
+ tag.tagFormatConstructed, 10))),
369
+ namedtype.NamedType('rr', RevReqContent().subtype(
370
+ explicitTag=tag.Tag(tag.tagClassContext,
371
+ tag.tagFormatSimple, 11))),
372
+ namedtype.NamedType('rp', RevRepContent().subtype(
373
+ explicitTag=tag.Tag(tag.tagClassContext,
374
+ tag.tagFormatConstructed, 12))),
375
+ namedtype.NamedType('ccr', CertReqMessages().subtype(
376
+ explicitTag=tag.Tag(tag.tagClassContext,
377
+ tag.tagFormatSimple, 13))),
378
+ namedtype.NamedType('ccp', CertRepMessage().subtype(
379
+ explicitTag=tag.Tag(tag.tagClassContext,
380
+ tag.tagFormatConstructed, 14))),
381
+ namedtype.NamedType('ckuann', CAKeyUpdAnnContent().subtype(
382
+ explicitTag=tag.Tag(tag.tagClassContext,
383
+ tag.tagFormatConstructed, 15))),
384
+ namedtype.NamedType('cann', CertAnnContent().subtype(
385
+ explicitTag=tag.Tag(tag.tagClassContext,
386
+ tag.tagFormatConstructed, 16))),
387
+ namedtype.NamedType('rann', RevAnnContent().subtype(
388
+ explicitTag=tag.Tag(tag.tagClassContext,
389
+ tag.tagFormatConstructed, 17))),
390
+ namedtype.NamedType('crlann', CRLAnnContent().subtype(
391
+ explicitTag=tag.Tag(tag.tagClassContext,
392
+ tag.tagFormatSimple, 18))),
393
+ namedtype.NamedType('pkiconf', PKIConfirmContent().subtype(
394
+ explicitTag=tag.Tag(tag.tagClassContext,
395
+ tag.tagFormatSimple, 19))),
396
+ namedtype.NamedType('nested', nestedMessageContent),
397
+ namedtype.NamedType('genm', GenMsgContent().subtype(
398
+ explicitTag=tag.Tag(tag.tagClassContext,
399
+ tag.tagFormatSimple, 21))),
400
+ namedtype.NamedType('genp', GenRepContent().subtype(
401
+ explicitTag=tag.Tag(tag.tagClassContext,
402
+ tag.tagFormatSimple, 22))),
403
+ namedtype.NamedType('error', ErrorMsgContent().subtype(
404
+ explicitTag=tag.Tag(tag.tagClassContext,
405
+ tag.tagFormatConstructed, 23))),
406
+ namedtype.NamedType('certConf', CertConfirmContent().subtype(
407
+ explicitTag=tag.Tag(tag.tagClassContext,
408
+ tag.tagFormatSimple, 24))),
409
+ namedtype.NamedType('pollReq', PollReqContent().subtype(
410
+ explicitTag=tag.Tag(tag.tagClassContext,
411
+ tag.tagFormatSimple, 25))),
412
+ namedtype.NamedType('pollRep', PollRepContent().subtype(
413
+ explicitTag=tag.Tag(tag.tagClassContext,
414
+ tag.tagFormatSimple, 26)))
415
+ )
416
+
417
+
418
+ class PKIMessage(univ.Sequence):
419
+ componentType = namedtype.NamedTypes(
420
+ namedtype.NamedType('header', PKIHeader()),
421
+ namedtype.NamedType('body', PKIBody()),
422
+ namedtype.OptionalNamedType('protection', PKIProtection().subtype(
423
+ explicitTag=tag.Tag(tag.tagClassContext,
424
+ tag.tagFormatSimple, 0))),
425
+ namedtype.OptionalNamedType('extraCerts', univ.SequenceOf(
426
+ componentType=CMPCertificate()).subtype(
427
+ subtypeSpec=constraint.ValueSizeConstraint(1, MAX)).subtype(
428
+ explicitTag=tag.Tag(tag.tagClassContext,
429
+ tag.tagFormatSimple, 1)))
430
+ )
431
+
432
+
433
+ class PKIMessages(univ.SequenceOf):
434
+ componentType = PKIMessage()
435
+ subtypeSpec=constraint.ValueSizeConstraint(1, MAX)
436
+
437
+
438
+ class ProtectedPart(univ.Sequence):
439
+ componentType = namedtype.NamedTypes(
440
+ namedtype.NamedType('header', PKIHeader()),
441
+ namedtype.NamedType('body', PKIBody())
442
+ )
443
+
444
+
445
+ # Added in CMP Updates
446
+ #
447
+ class RootCaKeyUpdateContent(univ.Sequence):
448
+ componentType = namedtype.NamedTypes(
449
+ namedtype.NamedType('newWithNew', CMPCertificate()),
450
+ namedtype.OptionalNamedType('newWithOld', CMPCertificate().subtype(
451
+ explicitTag=tag.Tag(tag.tagClassContext,
452
+ tag.tagFormatConstructed, 0))),
453
+ namedtype.OptionalNamedType('oldWithNew', CMPCertificate().subtype(
454
+ explicitTag=tag.Tag(tag.tagClassContext,
455
+ tag.tagFormatConstructed, 1)))
456
+ )
457
+
458
+
459
+ # Added in CMP Updates
460
+ #
461
+ class CRLSource(univ.Choice):
462
+ componentType = namedtype.NamedTypes(
463
+ namedtype.NamedType('dpn', DistributionPointName().subtype(
464
+ explicitTag=tag.Tag(tag.tagClassContext,
465
+ tag.tagFormatConstructed, 0))),
466
+ namedtype.NamedType('issuer', EncryptedKey().subtype(
467
+ explicitTag=tag.Tag(tag.tagClassContext,
468
+ tag.tagFormatConstructed, 1)))
469
+ )
470
+
471
+
472
+ # Added in CMP Updates
473
+ #
474
+ class CRLStatus(univ.Sequence):
475
+ componentType = namedtype.NamedTypes(
476
+ namedtype.NamedType('source', CRLSource()),
477
+ namedtype.OptionalNamedType('thisUpdate', Time())
478
+ )
479
+
480
+
481
+ # Added in CMP Updates
482
+ #
483
+ class CertReqTemplateContent(univ.Sequence):
484
+ componentType = namedtype.NamedTypes(
485
+ namedtype.NamedType('certTemplate', CertTemplate()),
486
+ namedtype.OptionalNamedType('keySpec', Controls())
487
+ )
488
+
489
+
490
+ # Object Identifiers for MAC algorithms
491
+
492
+ id_DHBasedMac = rfc4210.id_DHBasedMac
493
+
494
+ id_PasswordBasedMac = rfc4210.id_PasswordBasedMac
495
+
496
+
497
+ # Extended Key Usage extension for PKI entities used in CMP operations
498
+
499
+ id_kp_cmKGA = id_kp + (32,)
500
+
501
+
502
+ # The value for the LocalKeyId Attribute from PKCS#9 (RFC 2985)
503
+
504
+ class LocalKeyIdValue(univ.OctetString):
505
+ pass
506
+
507
+
508
+ # Additional CRMF Registration Controls
509
+
510
+ id_regCtrl_altCertTemplate = id_regCtrl + (7,)
511
+
512
+ class AltCertTemplate(AttributeTypeAndValue):
513
+ pass
514
+
515
+
516
+ id_regCtrl_algId = id_regCtrl + (11,)
517
+
518
+ class AlgIdCtrl(AlgorithmIdentifier):
519
+ pass
520
+
521
+
522
+ id_regCtrl_rsaKeyLen = id_regCtrl + (12,)
523
+
524
+ class RsaKeyLenCtrl(univ.Integer):
525
+ subtypeSpec = constraint.ValueRangeConstraint(1, MAX)
526
+
527
+
528
+ # CMP Information Types
529
+
530
+ id_it = id_pkix + (4,)
531
+
532
+ id_it_caProtEncCert = id_it + (1,)
533
+
534
+ class CAProtEncCertValue(CMPCertificate):
535
+ pass
536
+
537
+
538
+ id_it_signKeyPairTypes = id_it + (2,)
539
+
540
+ class SignKeyPairTypesValueclass(univ.SequenceOf):
541
+ componentType = AlgorithmIdentifier()
542
+
543
+
544
+ id_it_encKeyPairTypes = id_it + (3,)
545
+
546
+ class EncKeyPairTypesValue(univ.SequenceOf):
547
+ componentType = AlgorithmIdentifier()
548
+
549
+
550
+ id_it_preferredSymmAlg = id_it + (4,)
551
+
552
+ class PreferredSymmAlgValue(AlgorithmIdentifier):
553
+ pass
554
+
555
+
556
+ id_it_caKeyUpdateInfo = id_it + (5,)
557
+
558
+ class CAKeyUpdateInfoValue(CAKeyUpdAnnContent):
559
+ pass
560
+
561
+
562
+ id_it_currentCRL = id_it + (6,)
563
+
564
+ class CurrentCRLValue(CertificateList):
565
+ pass
566
+
567
+
568
+ id_it_unsupportedOIDs = id_it + (7,)
569
+
570
+ class UnsupportedOIDsValue(univ.SequenceOf):
571
+ componentType = univ.ObjectIdentifier()
572
+
573
+
574
+ id_it_keyPairParamReq = id_it + (10,)
575
+
576
+ class KeyPairParamReqValue(univ.ObjectIdentifier):
577
+ pass
578
+
579
+
580
+ id_it_keyPairParamRep = id_it + (11,)
581
+
582
+ class KeyPairParamRepValue(AlgorithmIdentifier):
583
+ pass
584
+
585
+
586
+ id_it_revPassphrase = id_it + (12,)
587
+
588
+ class RevPassphraseValue(EncryptedKey):
589
+ pass
590
+
591
+
592
+ id_it_implicitConfirm = id_it + (13,)
593
+
594
+ class ImplicitConfirmValue(univ.Null):
595
+ pass
596
+
597
+
598
+ id_it_confirmWaitTime = id_it + (14,)
599
+
600
+ class ConfirmWaitTimeValue(useful.GeneralizedTime):
601
+ pass
602
+
603
+
604
+ id_it_origPKIMessage = id_it + (15,)
605
+
606
+ class OrigPKIMessageValue(PKIMessages):
607
+ pass
608
+
609
+
610
+ id_it_suppLangTags = id_it + (16,)
611
+
612
+ class SuppLangTagsValue(univ.SequenceOf):
613
+ componentType = char.UTF8String()
614
+
615
+
616
+ # Added in CMP Updates
617
+ #
618
+ id_it_caCerts = id_it + (17,)
619
+
620
+ class CaCertsValue(univ.SequenceOf):
621
+ componentType = CMPCertificate()
622
+
623
+
624
+ # Added in CMP Updates
625
+ #
626
+ id_it_rootCaKeyUpdate = id_it + (18,)
627
+
628
+ class RootCaKeyUpdateValue(RootCaKeyUpdateContent):
629
+ pass
630
+
631
+
632
+ # Added in CMP Updates
633
+ #
634
+ id_it_certReqTemplate = id_it + (19,)
635
+
636
+ class CertReqTemplateValue(CertReqTemplateContent):
637
+ pass
638
+
639
+
640
+ # Added in CMP Updates
641
+ #
642
+ id_it_rootCaCert = id_it + (20,)
643
+
644
+ class RootCaCertValue(CMPCertificate):
645
+ pass
646
+
647
+
648
+ # Added in CMP Updates
649
+ #
650
+ id_it_certProfile = id_it + (21,)
651
+
652
+ class CertProfileValue(char.UTF8String):
653
+ pass
654
+
655
+
656
+ # Added in CMP Updates
657
+ #
658
+ id_it_crlStatusList = id_it + (22,)
659
+
660
+ class CRLStatusListValue(univ.SequenceOf):
661
+ componentType = CRLStatus()
662
+ subtypeSpec = constraint.ValueSizeConstraint(1, MAX)
663
+
664
+
665
+ # Added in CMP Updates
666
+ #
667
+ id_it_crls = id_it + (23,)
668
+
669
+ class CRLsValue(univ.SequenceOf):
670
+ componentType = CertificateList()
671
+ subtypeSpec = constraint.ValueSizeConstraint(1, MAX)
672
+
673
+
674
+ # Update the CMP Information Types Map
675
+
676
+ _cmpInfoTypeAndValueMapUpdate = {
677
+ id_it_caProtEncCert: CAProtEncCertValue(),
678
+ id_it_signKeyPairTypes: SignKeyPairTypesValueclass(),
679
+ id_it_encKeyPairTypes: EncKeyPairTypesValue(),
680
+ id_it_preferredSymmAlg: PreferredSymmAlgValue(),
681
+ id_it_caKeyUpdateInfo: CAKeyUpdateInfoValue(),
682
+ id_it_currentCRL: CurrentCRLValue(),
683
+ id_it_unsupportedOIDs: UnsupportedOIDsValue(),
684
+ id_it_keyPairParamReq: KeyPairParamReqValue(),
685
+ id_it_keyPairParamRep: KeyPairParamRepValue(),
686
+ id_it_revPassphrase: RevPassphraseValue(),
687
+ id_it_implicitConfirm: ImplicitConfirmValue(),
688
+ id_it_confirmWaitTime: ConfirmWaitTimeValue(),
689
+ id_it_origPKIMessage: OrigPKIMessageValue(),
690
+ id_it_suppLangTags: SuppLangTagsValue(),
691
+ id_it_caCerts: CaCertsValue(),
692
+ id_it_rootCaKeyUpdate: RootCaKeyUpdateValue(),
693
+ id_it_certReqTemplate: CertReqTemplateValue(),
694
+ id_it_rootCaCert: RootCaCertValue(),
695
+ id_it_certProfile: CertProfileValue(),
696
+ id_it_crlStatusList: CRLStatusListValue(),
697
+ id_it_crls: CRLsValue(),
698
+ }
699
+
700
+ cmpInfoTypeAndValueMap.update(_cmpInfoTypeAndValueMapUpdate)
701
+
702
+
703
+ # Update the CMS Attribute Map
704
+
705
+ _cmsAttributesMapUpdate = {
706
+ id_regCtrl_altCertTemplate: AltCertTemplate(),
707
+ id_regCtrl_algId: AlgIdCtrl(),
708
+ id_regCtrl_rsaKeyLen: RsaKeyLenCtrl(),
709
+ }
710
+
711
+ cmsAttributesMap.update(_cmsAttributesMapUpdate)
712
+
713
+
714
+ # Since pyasn1 does not naturally handle recursive definitions, this hack:
715
+ #
716
+ NestedMessageContent._componentType = PKIMessages()
717
+ nestedMessageContent._componentType = PKIMessages()