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,404 @@
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
+ # An Internet Attribute Certificate Profile for Authorization
10
+ #
11
+ # ASN.1 source from:
12
+ # https://www.rfc-editor.org/rfc/rfc5275.txt
13
+ #
14
+
15
+ from pyasn1.type import constraint
16
+ from pyasn1.type import namedtype
17
+ from pyasn1.type import namedval
18
+ from pyasn1.type import opentype
19
+ from pyasn1.type import tag
20
+ from pyasn1.type import univ
21
+ from pyasn1.type import useful
22
+
23
+ from pyasn1_alt_modules import rfc3565
24
+ from pyasn1_alt_modules import rfc5280
25
+ from pyasn1_alt_modules import rfc5652
26
+ from pyasn1_alt_modules import rfc5751
27
+ from pyasn1_alt_modules import rfc5755
28
+
29
+ MAX = float('inf')
30
+
31
+
32
+ # Initialize the map for GLAQueryRequests and GLAQueryResponses
33
+
34
+ glaQueryRRMap = { }
35
+
36
+
37
+ # Imports from RFC 3565
38
+
39
+ id_aes128_wrap = rfc3565.id_aes128_wrap
40
+
41
+
42
+ # Imports from RFC 5280
43
+
44
+ AlgorithmIdentifier = rfc5280.AlgorithmIdentifier
45
+
46
+ Certificate = rfc5280.Certificate
47
+
48
+ GeneralName = rfc5280.GeneralName
49
+
50
+
51
+ # Imports from RFC 5652
52
+
53
+ CertificateSet = rfc5652.CertificateSet
54
+
55
+ KEKIdentifier = rfc5652.KEKIdentifier
56
+
57
+ RecipientInfos = rfc5652.RecipientInfos
58
+
59
+
60
+ # Imports from RFC 5751
61
+
62
+ SMIMECapability = rfc5751.SMIMECapability
63
+
64
+
65
+ # Imports from RFC 5755
66
+
67
+ AttributeCertificate = rfc5755.AttributeCertificate
68
+
69
+
70
+ # The GL symmetric key distribution object identifier arc
71
+
72
+ id_skd = univ.ObjectIdentifier((1, 2, 840, 113549, 1, 9, 16, 8,))
73
+
74
+
75
+ # The GL Use KEK control attribute
76
+
77
+ id_skd_glUseKEK = id_skd + (1,)
78
+
79
+
80
+ class Certificates(univ.Sequence):
81
+ componentType = namedtype.NamedTypes(
82
+ namedtype.OptionalNamedType('pKC',
83
+ Certificate().subtype(implicitTag=tag.Tag(
84
+ tag.tagClassContext, tag.tagFormatSimple, 0))),
85
+ namedtype.OptionalNamedType('aC',
86
+ univ.SequenceOf(componentType=AttributeCertificate()).subtype(
87
+ subtypeSpec=constraint.ValueSizeConstraint(1, MAX)).subtype(
88
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
89
+ namedtype.OptionalNamedType('certPath',
90
+ CertificateSet().subtype(implicitTag=tag.Tag(
91
+ tag.tagClassContext, tag.tagFormatSimple, 2)))
92
+ )
93
+
94
+
95
+ class GLInfo(univ.Sequence):
96
+ componentType = namedtype.NamedTypes(
97
+ namedtype.NamedType('glName', GeneralName()),
98
+ namedtype.NamedType('glAddress', GeneralName())
99
+ )
100
+
101
+
102
+ class GLOwnerInfo(univ.Sequence):
103
+ componentType = namedtype.NamedTypes(
104
+ namedtype.NamedType('glOwnerName', GeneralName()),
105
+ namedtype.NamedType('glOwnerAddress', GeneralName()),
106
+ namedtype.OptionalNamedType('certificates', Certificates())
107
+ )
108
+
109
+
110
+ class GLAdministration(univ.Integer):
111
+ namedValues = namedval.NamedValues(
112
+ ('unmanaged', 0),
113
+ ('managed', 1),
114
+ ('closed', 2)
115
+ )
116
+
117
+
118
+ requested_algorithm = SMIMECapability().subtype(
119
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 4))
120
+ requested_algorithm['capabilityID'] = id_aes128_wrap
121
+
122
+
123
+ class GLKeyAttributes(univ.Sequence):
124
+ componentType = namedtype.NamedTypes(
125
+ namedtype.DefaultedNamedType('rekeyControlledByGLO',
126
+ univ.Boolean().subtype(value=0,
127
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
128
+ namedtype.DefaultedNamedType('recipientsNotMutuallyAware',
129
+ univ.Boolean().subtype(value=1,
130
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
131
+ namedtype.DefaultedNamedType('duration',
132
+ univ.Integer().subtype(value=0,
133
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2))),
134
+ namedtype.DefaultedNamedType('generationCounter',
135
+ univ.Integer().subtype(value=2,
136
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 3))),
137
+ namedtype.DefaultedNamedType('requestedAlgorithm', requested_algorithm)
138
+ )
139
+
140
+
141
+ class GLUseKEK(univ.Sequence):
142
+ componentType = namedtype.NamedTypes(
143
+ namedtype.NamedType('glInfo', GLInfo()),
144
+ namedtype.NamedType('glOwnerInfo',
145
+ univ.SequenceOf(componentType=GLOwnerInfo()).subtype(
146
+ subtypeSpec=constraint.ValueSizeConstraint(1, MAX))),
147
+ namedtype.DefaultedNamedType('glAdministration',
148
+ GLAdministration().subtype(value=1)),
149
+ namedtype.OptionalNamedType('glKeyAttributes', GLKeyAttributes())
150
+ )
151
+
152
+
153
+ # The Delete GL control attribute
154
+
155
+ id_skd_glDelete = id_skd + (2,)
156
+
157
+
158
+ class DeleteGL(GeneralName):
159
+ pass
160
+
161
+
162
+ # The Add GL Member control attribute
163
+
164
+ id_skd_glAddMember = id_skd + (3,)
165
+
166
+
167
+ class GLMember(univ.Sequence):
168
+ componentType = namedtype.NamedTypes(
169
+ namedtype.NamedType('glMemberName', GeneralName()),
170
+ namedtype.OptionalNamedType('glMemberAddress', GeneralName()),
171
+ namedtype.OptionalNamedType('certificates', Certificates())
172
+ )
173
+
174
+
175
+ class GLAddMember(univ.Sequence):
176
+ componentType = namedtype.NamedTypes(
177
+ namedtype.NamedType('glName', GeneralName()),
178
+ namedtype.NamedType('glMember', GLMember())
179
+ )
180
+
181
+
182
+ # The Delete GL Member control attribute
183
+
184
+ id_skd_glDeleteMember = id_skd + (4,)
185
+
186
+
187
+ class GLDeleteMember(univ.Sequence):
188
+ componentType = namedtype.NamedTypes(
189
+ namedtype.NamedType('glName', GeneralName()),
190
+ namedtype.NamedType('glMemberToDelete', GeneralName())
191
+ )
192
+
193
+
194
+ # The GL Rekey control attribute
195
+
196
+ id_skd_glRekey = id_skd + (5,)
197
+
198
+
199
+ class GLNewKeyAttributes(univ.Sequence):
200
+ componentType = namedtype.NamedTypes(
201
+ namedtype.OptionalNamedType('rekeyControlledByGLO',
202
+ univ.Boolean().subtype(implicitTag=tag.Tag(
203
+ tag.tagClassContext, tag.tagFormatSimple, 0))),
204
+ namedtype.OptionalNamedType('recipientsNotMutuallyAware',
205
+ univ.Boolean().subtype(implicitTag=tag.Tag(
206
+ tag.tagClassContext, tag.tagFormatSimple, 1))),
207
+ namedtype.OptionalNamedType('duration',
208
+ univ.Integer().subtype(implicitTag=tag.Tag(
209
+ tag.tagClassContext, tag.tagFormatSimple, 2))),
210
+ namedtype.OptionalNamedType('generationCounter',
211
+ univ.Integer().subtype(implicitTag=tag.Tag(
212
+ tag.tagClassContext, tag.tagFormatSimple, 3))),
213
+ namedtype.OptionalNamedType('requestedAlgorithm',
214
+ AlgorithmIdentifier().subtype(implicitTag=tag.Tag(
215
+ tag.tagClassContext, tag.tagFormatSimple, 4)))
216
+ )
217
+
218
+
219
+ class GLRekey(univ.Sequence):
220
+ componentType = namedtype.NamedTypes(
221
+ namedtype.NamedType('glName', GeneralName()),
222
+ namedtype.OptionalNamedType('glAdministration', GLAdministration()),
223
+ namedtype.OptionalNamedType('glNewKeyAttributes', GLNewKeyAttributes()),
224
+ namedtype.OptionalNamedType('glRekeyAllGLKeys', univ.Boolean())
225
+ )
226
+
227
+
228
+ # The Add and Delete GL Owner control attributes
229
+
230
+ id_skd_glAddOwner = id_skd + (6,)
231
+
232
+ id_skd_glRemoveOwner = id_skd + (7,)
233
+
234
+
235
+ class GLOwnerAdministration(univ.Sequence):
236
+ componentType = namedtype.NamedTypes(
237
+ namedtype.NamedType('glName', GeneralName()),
238
+ namedtype.NamedType('glOwnerInfo', GLOwnerInfo())
239
+ )
240
+
241
+
242
+ # The GL Key Compromise control attribute
243
+
244
+ id_skd_glKeyCompromise = id_skd + (8,)
245
+
246
+
247
+ class GLKCompromise(GeneralName):
248
+ pass
249
+
250
+
251
+ # The GL Key Refresh control attribute
252
+
253
+ id_skd_glkRefresh = id_skd + (9,)
254
+
255
+
256
+ class Date(univ.Sequence):
257
+ componentType = namedtype.NamedTypes(
258
+ namedtype.NamedType('start', useful.GeneralizedTime()),
259
+ namedtype.OptionalNamedType('end', useful.GeneralizedTime())
260
+ )
261
+
262
+
263
+ class GLKRefresh(univ.Sequence):
264
+ componentType = namedtype.NamedTypes(
265
+ namedtype.NamedType('glName', GeneralName()),
266
+ namedtype.NamedType('dates',
267
+ univ.SequenceOf(componentType=Date()).subtype(
268
+ subtypeSpec=constraint.ValueSizeConstraint(1, MAX)))
269
+ )
270
+
271
+
272
+ # The GLA Query Request control attribute
273
+
274
+ id_skd_glaQueryRequest = id_skd + (11,)
275
+
276
+
277
+ class GLAQueryRequest(univ.Sequence):
278
+ componentType = namedtype.NamedTypes(
279
+ namedtype.NamedType('glaRequestType', univ.ObjectIdentifier()),
280
+ namedtype.NamedType('glaRequestValue', univ.Any(),
281
+ openType=opentype.OpenType('glaRequestType', glaQueryRRMap))
282
+ )
283
+
284
+
285
+ # The GLA Query Response control attribute
286
+
287
+ id_skd_glaQueryResponse = id_skd + (12,)
288
+
289
+
290
+ class GLAQueryResponse(univ.Sequence):
291
+ componentType = namedtype.NamedTypes(
292
+ namedtype.NamedType('glaResponseType', univ.ObjectIdentifier()),
293
+ namedtype.NamedType('glaResponseValue', univ.Any(),
294
+ openType=opentype.OpenType('glaResponseType', glaQueryRRMap))
295
+ )
296
+
297
+
298
+ # The GLA Request/Response (glaRR) arc for glaRequestType/glaResponseType
299
+
300
+ id_cmc_glaRR = univ.ObjectIdentifier((1, 3, 6, 1, 5, 5, 7, 7, 99,))
301
+
302
+
303
+ # The Algorithm Request
304
+
305
+ id_cmc_gla_skdAlgRequest = id_cmc_glaRR + (1,)
306
+
307
+
308
+ class SKDAlgRequest(univ.Null):
309
+ pass
310
+
311
+
312
+ # The Algorithm Response
313
+
314
+ id_cmc_gla_skdAlgResponse = id_cmc_glaRR + (2,)
315
+
316
+ SMIMECapabilities = rfc5751.SMIMECapabilities
317
+
318
+
319
+ # The control attribute to request an updated certificate to the GLA and
320
+ # the control attribute to return an updated certificate to the GLA
321
+
322
+ id_skd_glProvideCert = id_skd + (13,)
323
+
324
+ id_skd_glManageCert = id_skd + (14,)
325
+
326
+
327
+ class GLManageCert(univ.Sequence):
328
+ componentType = namedtype.NamedTypes(
329
+ namedtype.NamedType('glName', GeneralName()),
330
+ namedtype.NamedType('glMember', GLMember())
331
+ )
332
+
333
+
334
+ # The control attribute to distribute the GL shared KEK
335
+
336
+ id_skd_glKey = id_skd + (15,)
337
+
338
+
339
+ class GLKey(univ.Sequence):
340
+ componentType = namedtype.NamedTypes(
341
+ namedtype.NamedType('glName', GeneralName()),
342
+ namedtype.NamedType('glIdentifier', KEKIdentifier()),
343
+ namedtype.NamedType('glkWrapped', RecipientInfos()),
344
+ namedtype.NamedType('glkAlgorithm', AlgorithmIdentifier()),
345
+ namedtype.NamedType('glkNotBefore', useful.GeneralizedTime()),
346
+ namedtype.NamedType('glkNotAfter', useful.GeneralizedTime())
347
+ )
348
+
349
+
350
+ # The CMC error types
351
+
352
+ id_cet_skdFailInfo = univ.ObjectIdentifier((1, 3, 6, 1, 5, 5, 7, 15, 1,))
353
+
354
+
355
+ class SKDFailInfo(univ.Integer):
356
+ namedValues = namedval.NamedValues(
357
+ ('unspecified', 0),
358
+ ('closedGL', 1),
359
+ ('unsupportedDuration', 2),
360
+ ('noGLACertificate', 3),
361
+ ('invalidCert', 4),
362
+ ('unsupportedAlgorithm', 5),
363
+ ('noGLONameMatch', 6),
364
+ ('invalidGLName', 7),
365
+ ('nameAlreadyInUse', 8),
366
+ ('noSpam', 9),
367
+ ('alreadyAMember', 11),
368
+ ('notAMember', 12),
369
+ ('alreadyAnOwner', 13),
370
+ ('notAnOwner', 14)
371
+ )
372
+
373
+
374
+ # Update the map for GLAQueryRequests and GLAQueryResponses
375
+
376
+ _glaQueryRRMapUpdate = {
377
+ id_cmc_gla_skdAlgRequest: univ.Null(""),
378
+ id_cmc_gla_skdAlgResponse: SMIMECapabilities(),
379
+ }
380
+
381
+ glaQueryRRMap.update(_glaQueryRRMapUpdate)
382
+
383
+
384
+ # Update the map for CMC control attributes; since CMS Attributes and
385
+ # CMC Controls both use 'attrType', one map is used for both
386
+
387
+ _cmcControlAttributesMapUpdate = {
388
+ id_skd_glUseKEK: GLUseKEK(),
389
+ id_skd_glDelete: DeleteGL(),
390
+ id_skd_glAddMember: GLAddMember(),
391
+ id_skd_glDeleteMember: GLDeleteMember(),
392
+ id_skd_glRekey: GLRekey(),
393
+ id_skd_glAddOwner: GLOwnerAdministration(),
394
+ id_skd_glRemoveOwner: GLOwnerAdministration(),
395
+ id_skd_glKeyCompromise: GLKCompromise(),
396
+ id_skd_glkRefresh: GLKRefresh(),
397
+ id_skd_glaQueryRequest: GLAQueryRequest(),
398
+ id_skd_glaQueryResponse: GLAQueryResponse(),
399
+ id_skd_glProvideCert: GLManageCert(),
400
+ id_skd_glManageCert: GLManageCert(),
401
+ id_skd_glKey: GLKey(),
402
+ }
403
+
404
+ rfc5652.cmsAttributesMap.update(_cmcControlAttributesMapUpdate)
@@ -0,0 +1,82 @@
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) 2021-2024, Vigil Security, LLC
8
+ # License: http://vigilsec.com/pyasn1-alt-modules-license.txt
9
+ #
10
+ # Using SCVP to convey Long-Term Evidence Records
11
+ #
12
+ # ASN.1 source from:
13
+ # https://www.rfc-editor.org/rfc/rfc5276.txt
14
+ #
15
+
16
+ from pyasn1.type import constraint
17
+ from pyasn1.type import namedtype
18
+ from pyasn1.type import namedval
19
+ from pyasn1.type import univ
20
+
21
+ from pyasn1_alt_modules import rfc4998
22
+ from pyasn1_alt_modules import rfc5055
23
+ from pyasn1_alt_modules import opentypemap
24
+
25
+ scvpWantBackMap = opentypemap.get('scvpWantBackMap')
26
+
27
+ MAX = float('inf')
28
+
29
+
30
+ # Imports from RFC 4998 and RFC 5055
31
+
32
+ EvidenceRecord = rfc4998.EvidenceRecord
33
+
34
+ CertBundle = rfc5055.CertBundle
35
+
36
+
37
+ # Long-Term Evidence Records in SCVP
38
+
39
+ class EvidenceRecordWantBack(univ.Sequence):
40
+ componentType = namedtype.NamedTypes(
41
+ namedtype.NamedType('targetWantBack', univ.ObjectIdentifier()),
42
+ namedtype.OptionalNamedType('evidenceRecord', EvidenceRecord())
43
+ )
44
+
45
+
46
+ class EvidenceRecordWantBacks(univ.SequenceOf):
47
+ componentType = EvidenceRecordWantBack()
48
+ subtypeSpec = constraint.ValueSizeConstraint(1, MAX)
49
+
50
+
51
+ class EvidenceRecords(univ.SequenceOf):
52
+ componentType = EvidenceRecord()
53
+ subtypeSpec = constraint.ValueSizeConstraint(1, MAX)
54
+
55
+
56
+ id_swb = univ.ObjectIdentifier((1, 3, 6, 1, 5, 5, 7, 18))
57
+
58
+ id_swb_partial_cert_path = id_swb + (15,)
59
+
60
+ id_swb_ers_pkc_cert = id_swb + (16,)
61
+
62
+ id_swb_ers_best_cert_path = id_swb + (17,)
63
+
64
+ id_swb_ers_partial_cert_path = id_swb + (18,)
65
+
66
+ id_swb_ers_revocation_info = id_swb + (19,)
67
+
68
+ id_swb_ers_all = id_swb + (20,)
69
+
70
+
71
+ # Update the SCVP Want Back Map
72
+
73
+ _scvpWantBackMapUpdate = {
74
+ id_swb_partial_cert_path: CertBundle(),
75
+ id_swb_ers_pkc_cert: EvidenceRecord(),
76
+ id_swb_ers_best_cert_path: EvidenceRecord(),
77
+ id_swb_ers_partial_cert_path: EvidenceRecord(),
78
+ id_swb_ers_revocation_info: EvidenceRecords(),
79
+ id_swb_ers_all: EvidenceRecordWantBacks(),
80
+ }
81
+
82
+ scvpWantBackMap.update(_scvpWantBackMapUpdate)