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,1666 @@
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
+ # Updated by Russ Housley for ORAddress Extension Attribute opentype support.
7
+ # Updated by Russ Housley for AlgorithmIdentifier opentype support.
8
+ # Updated by Russ Housley for https://github.com/etingof/pyasn1-modules/pull/139.
9
+ # Updated by Russ Housley to include the opentypemap manager.
10
+ # Updated by CBonnell to populate the policyQualifierInfosMap.
11
+ # Updated by CBonnell to add ValueSizeConstraint to PolicyInformation.policyQualifiers.
12
+ #
13
+ # Copyright (c) 2005-2020, Ilya Etingof <etingof@gmail.com>
14
+ # Copyright (c) 2021-2024, Vigil Security, LLC
15
+ # License: http://vigilsec.com/pyasn1-alt-modules-license.txt
16
+ #
17
+ # Internet X.509 Public Key Infrastructure Certificate and Certificate
18
+ # Revocation List (CRL) Profile
19
+ #
20
+ # ASN.1 source from:
21
+ # https://www.rfc-editor.org/rfc/rfc5280.txt
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 opentypemap
33
+
34
+ algorithmIdentifierMap = opentypemap.get('algorithmIdentifierMap')
35
+
36
+ certificateAttributesMap = opentypemap.get('certificateAttributesMap')
37
+
38
+ certificateExtensionsMap = opentypemap.get('certificateExtensionsMap')
39
+
40
+ orAddressExtensionAttributesMap = opentypemap.get('orAddressExtensionAttributesMap')
41
+
42
+ otherNamesMap = anotherNameMap = opentypemap.get('otherNamesMap')
43
+
44
+ policyQualifierInfosMap = opentypemap.get('policyQualifierInfosMap')
45
+
46
+ MAX = float('inf')
47
+
48
+
49
+ def _buildOid(*components):
50
+ output = []
51
+ for x in tuple(components):
52
+ if isinstance(x, univ.ObjectIdentifier):
53
+ output.extend(list(x))
54
+ else:
55
+ output.append(int(x))
56
+
57
+ return univ.ObjectIdentifier(output)
58
+
59
+
60
+ ub_e163_4_sub_address_length = univ.Integer(40)
61
+
62
+ ub_e163_4_number_length = univ.Integer(15)
63
+
64
+ unformatted_postal_address = univ.Integer(16)
65
+
66
+
67
+ class TerminalType(univ.Integer):
68
+ pass
69
+
70
+
71
+ TerminalType.namedValues = namedval.NamedValues(
72
+ ('telex', 3),
73
+ ('teletex', 4),
74
+ ('g3-facsimile', 5),
75
+ ('g4-facsimile', 6),
76
+ ('ia5-terminal', 7),
77
+ ('videotex', 8)
78
+ )
79
+
80
+
81
+ class Extension(univ.Sequence):
82
+ pass
83
+
84
+
85
+ Extension.componentType = namedtype.NamedTypes(
86
+ namedtype.NamedType('extnID', univ.ObjectIdentifier()),
87
+ namedtype.DefaultedNamedType('critical', univ.Boolean().subtype(value=0)),
88
+ namedtype.NamedType('extnValue', univ.OctetString())
89
+ )
90
+
91
+
92
+ class Extensions(univ.SequenceOf):
93
+ pass
94
+
95
+
96
+ Extensions.componentType = Extension()
97
+ Extensions.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
98
+
99
+ physical_delivery_personal_name = univ.Integer(13)
100
+
101
+ ub_unformatted_address_length = univ.Integer(180)
102
+
103
+ ub_pds_parameter_length = univ.Integer(30)
104
+
105
+ ub_pds_physical_address_lines = univ.Integer(6)
106
+
107
+
108
+ class UnformattedPostalAddress(univ.Set):
109
+ pass
110
+
111
+
112
+ UnformattedPostalAddress.componentType = namedtype.NamedTypes(
113
+ namedtype.OptionalNamedType('printable-address', univ.SequenceOf(componentType=char.PrintableString().subtype(
114
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_pds_parameter_length)))),
115
+ namedtype.OptionalNamedType('teletex-string', char.TeletexString().subtype(
116
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_unformatted_address_length)))
117
+ )
118
+
119
+ ub_organization_name = univ.Integer(64)
120
+
121
+
122
+ class X520OrganizationName(univ.Choice):
123
+ pass
124
+
125
+
126
+ X520OrganizationName.componentType = namedtype.NamedTypes(
127
+ namedtype.NamedType('teletexString', char.TeletexString().subtype(
128
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_organization_name))),
129
+ namedtype.NamedType('printableString', char.PrintableString().subtype(
130
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_organization_name))),
131
+ namedtype.NamedType('universalString', char.UniversalString().subtype(
132
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_organization_name))),
133
+ namedtype.NamedType('utf8String',
134
+ char.UTF8String().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_organization_name))),
135
+ namedtype.NamedType('bmpString',
136
+ char.BMPString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_organization_name)))
137
+ )
138
+
139
+ ub_x121_address_length = univ.Integer(16)
140
+
141
+ pds_name = univ.Integer(7)
142
+
143
+ id_pkix = _buildOid(1, 3, 6, 1, 5, 5, 7)
144
+
145
+ id_kp = _buildOid(id_pkix, 3)
146
+
147
+ ub_postal_code_length = univ.Integer(16)
148
+
149
+
150
+ class PostalCode(univ.Choice):
151
+ pass
152
+
153
+
154
+ PostalCode.componentType = namedtype.NamedTypes(
155
+ namedtype.NamedType('numeric-code', char.NumericString().subtype(
156
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_postal_code_length))),
157
+ namedtype.NamedType('printable-code', char.PrintableString().subtype(
158
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_postal_code_length)))
159
+ )
160
+
161
+ ub_generation_qualifier_length = univ.Integer(3)
162
+
163
+ unique_postal_name = univ.Integer(20)
164
+
165
+
166
+ class DomainComponent(char.IA5String):
167
+ pass
168
+
169
+
170
+ ub_domain_defined_attribute_value_length = univ.Integer(128)
171
+
172
+ ub_match = univ.Integer(128)
173
+
174
+ id_at = _buildOid(2, 5, 4)
175
+
176
+
177
+ class AttributeType(univ.ObjectIdentifier):
178
+ pass
179
+
180
+
181
+ id_at_organizationalUnitName = _buildOid(id_at, 11)
182
+
183
+ terminal_type = univ.Integer(23)
184
+
185
+
186
+ class PDSParameter(univ.Set):
187
+ pass
188
+
189
+
190
+ PDSParameter.componentType = namedtype.NamedTypes(
191
+ namedtype.OptionalNamedType('printable-string', char.PrintableString().subtype(
192
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_pds_parameter_length))),
193
+ namedtype.OptionalNamedType('teletex-string', char.TeletexString().subtype(
194
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_pds_parameter_length)))
195
+ )
196
+
197
+
198
+ class PhysicalDeliveryPersonalName(PDSParameter):
199
+ pass
200
+
201
+
202
+ ub_surname_length = univ.Integer(40)
203
+
204
+ id_ad = _buildOid(id_pkix, 48)
205
+
206
+ ub_domain_defined_attribute_type_length = univ.Integer(8)
207
+
208
+
209
+ class TeletexDomainDefinedAttribute(univ.Sequence):
210
+ pass
211
+
212
+
213
+ TeletexDomainDefinedAttribute.componentType = namedtype.NamedTypes(
214
+ namedtype.NamedType('type', char.TeletexString().subtype(
215
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_domain_defined_attribute_type_length))),
216
+ namedtype.NamedType('value', char.TeletexString().subtype(
217
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_domain_defined_attribute_value_length)))
218
+ )
219
+
220
+ ub_domain_defined_attributes = univ.Integer(4)
221
+
222
+
223
+ class TeletexDomainDefinedAttributes(univ.SequenceOf):
224
+ pass
225
+
226
+
227
+ TeletexDomainDefinedAttributes.componentType = TeletexDomainDefinedAttribute()
228
+ TeletexDomainDefinedAttributes.sizeSpec = constraint.ValueSizeConstraint(1, ub_domain_defined_attributes)
229
+
230
+ extended_network_address = univ.Integer(22)
231
+
232
+ ub_locality_name = univ.Integer(128)
233
+
234
+
235
+ class X520LocalityName(univ.Choice):
236
+ pass
237
+
238
+
239
+ X520LocalityName.componentType = namedtype.NamedTypes(
240
+ namedtype.NamedType('teletexString',
241
+ char.TeletexString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_locality_name))),
242
+ namedtype.NamedType('printableString', char.PrintableString().subtype(
243
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_locality_name))),
244
+ namedtype.NamedType('universalString', char.UniversalString().subtype(
245
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_locality_name))),
246
+ namedtype.NamedType('utf8String',
247
+ char.UTF8String().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_locality_name))),
248
+ namedtype.NamedType('bmpString',
249
+ char.BMPString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_locality_name)))
250
+ )
251
+
252
+ teletex_organization_name = univ.Integer(3)
253
+
254
+ ub_given_name_length = univ.Integer(16)
255
+
256
+ ub_initials_length = univ.Integer(5)
257
+
258
+
259
+ class PersonalName(univ.Set):
260
+ pass
261
+
262
+
263
+ PersonalName.componentType = namedtype.NamedTypes(
264
+ namedtype.NamedType('surname', char.PrintableString().subtype(
265
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_surname_length)).subtype(
266
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
267
+ namedtype.OptionalNamedType('given-name', char.PrintableString().subtype(
268
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_given_name_length)).subtype(
269
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
270
+ namedtype.OptionalNamedType('initials', char.PrintableString().subtype(
271
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_initials_length)).subtype(
272
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2))),
273
+ namedtype.OptionalNamedType('generation-qualifier', char.PrintableString().subtype(
274
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_generation_qualifier_length)).subtype(
275
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 3)))
276
+ )
277
+
278
+ ub_organizational_unit_name_length = univ.Integer(32)
279
+
280
+
281
+ class OrganizationalUnitName(char.PrintableString):
282
+ pass
283
+
284
+
285
+ OrganizationalUnitName.subtypeSpec = constraint.ValueSizeConstraint(1, ub_organizational_unit_name_length)
286
+
287
+ id_at_generationQualifier = _buildOid(id_at, 44)
288
+
289
+
290
+ class Version(univ.Integer):
291
+ pass
292
+
293
+
294
+ Version.namedValues = namedval.NamedValues(
295
+ ('v1', 0),
296
+ ('v2', 1),
297
+ ('v3', 2)
298
+ )
299
+
300
+
301
+ class CertificateSerialNumber(univ.Integer):
302
+ pass
303
+
304
+
305
+ class AlgorithmIdentifier(univ.Sequence):
306
+ componentType = namedtype.NamedTypes(
307
+ namedtype.NamedType('algorithm', univ.ObjectIdentifier()),
308
+ namedtype.OptionalNamedType('parameters', univ.Any(),
309
+ openType=opentype.OpenType('algorithm', algorithmIdentifierMap)
310
+ )
311
+ )
312
+
313
+
314
+ class Time(univ.Choice):
315
+ pass
316
+
317
+
318
+ Time.componentType = namedtype.NamedTypes(
319
+ namedtype.NamedType('utcTime', useful.UTCTime()),
320
+ namedtype.NamedType('generalTime', useful.GeneralizedTime())
321
+ )
322
+
323
+
324
+ class AttributeValue(univ.Any):
325
+ pass
326
+
327
+
328
+ class AttributeTypeAndValue(univ.Sequence):
329
+ componentType = namedtype.NamedTypes(
330
+ namedtype.NamedType('type', AttributeType()),
331
+ namedtype.NamedType(
332
+ 'value', AttributeValue(),
333
+ openType=opentype.OpenType('type', certificateAttributesMap)
334
+ )
335
+ )
336
+
337
+
338
+ class RelativeDistinguishedName(univ.SetOf):
339
+ pass
340
+
341
+
342
+ RelativeDistinguishedName.componentType = AttributeTypeAndValue()
343
+ RelativeDistinguishedName.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
344
+
345
+
346
+ class RDNSequence(univ.SequenceOf):
347
+ pass
348
+
349
+
350
+ RDNSequence.componentType = RelativeDistinguishedName()
351
+
352
+
353
+ class Name(univ.Choice):
354
+ pass
355
+
356
+
357
+ Name.componentType = namedtype.NamedTypes(
358
+ namedtype.NamedType('rdnSequence', RDNSequence())
359
+ )
360
+
361
+
362
+ class TBSCertList(univ.Sequence):
363
+ pass
364
+
365
+
366
+ TBSCertList.componentType = namedtype.NamedTypes(
367
+ namedtype.OptionalNamedType('version', Version()),
368
+ namedtype.NamedType('signature', AlgorithmIdentifier()),
369
+ namedtype.NamedType('issuer', Name()),
370
+ namedtype.NamedType('thisUpdate', Time()),
371
+ namedtype.OptionalNamedType('nextUpdate', Time()),
372
+ namedtype.OptionalNamedType(
373
+ 'revokedCertificates', univ.SequenceOf(
374
+ componentType=univ.Sequence(
375
+ componentType=namedtype.NamedTypes(
376
+ namedtype.NamedType('userCertificate', CertificateSerialNumber()),
377
+ namedtype.NamedType('revocationDate', Time()),
378
+ namedtype.OptionalNamedType('crlEntryExtensions', Extensions())
379
+ )
380
+ )
381
+ )
382
+ ),
383
+ namedtype.OptionalNamedType(
384
+ 'crlExtensions', Extensions().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0)))
385
+ )
386
+
387
+
388
+ class CertificateList(univ.Sequence):
389
+ pass
390
+
391
+
392
+ CertificateList.componentType = namedtype.NamedTypes(
393
+ namedtype.NamedType('tbsCertList', TBSCertList()),
394
+ namedtype.NamedType('signatureAlgorithm', AlgorithmIdentifier()),
395
+ namedtype.NamedType('signature', univ.BitString())
396
+ )
397
+
398
+
399
+ class PhysicalDeliveryOfficeName(PDSParameter):
400
+ pass
401
+
402
+
403
+ ub_extension_attributes = univ.Integer(256)
404
+
405
+
406
+ class ExtensionAttribute(univ.Sequence):
407
+ componentType = namedtype.NamedTypes(
408
+ namedtype.NamedType(
409
+ 'extension-attribute-type',
410
+ univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint(0, ub_extension_attributes)).subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
411
+ namedtype.NamedType(
412
+ 'extension-attribute-value',
413
+ univ.Any().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)),
414
+ openType=opentype.OpenType('extension-attribute-type', orAddressExtensionAttributesMap))
415
+ )
416
+
417
+ id_qt = _buildOid(id_pkix, 2)
418
+
419
+ id_qt_cps = _buildOid(id_qt, 1)
420
+
421
+ id_at_stateOrProvinceName = _buildOid(id_at, 8)
422
+
423
+ id_at_title = _buildOid(id_at, 12)
424
+
425
+ id_at_serialNumber = _buildOid(id_at, 5)
426
+
427
+
428
+ class X520dnQualifier(char.PrintableString):
429
+ pass
430
+
431
+
432
+ class PosteRestanteAddress(PDSParameter):
433
+ pass
434
+
435
+
436
+ poste_restante_address = univ.Integer(19)
437
+
438
+
439
+ class UniqueIdentifier(univ.BitString):
440
+ pass
441
+
442
+
443
+ class Validity(univ.Sequence):
444
+ pass
445
+
446
+
447
+ Validity.componentType = namedtype.NamedTypes(
448
+ namedtype.NamedType('notBefore', Time()),
449
+ namedtype.NamedType('notAfter', Time())
450
+ )
451
+
452
+
453
+ class SubjectPublicKeyInfo(univ.Sequence):
454
+ pass
455
+
456
+
457
+ SubjectPublicKeyInfo.componentType = namedtype.NamedTypes(
458
+ namedtype.NamedType('algorithm', AlgorithmIdentifier()),
459
+ namedtype.NamedType('subjectPublicKey', univ.BitString())
460
+ )
461
+
462
+
463
+ class TBSCertificate(univ.Sequence):
464
+ pass
465
+
466
+
467
+ TBSCertificate.componentType = namedtype.NamedTypes(
468
+ namedtype.DefaultedNamedType('version',
469
+ Version().subtype(explicitTag=tag.Tag(tag.tagClassContext,
470
+ tag.tagFormatSimple, 0)).subtype(value="v1")),
471
+ namedtype.NamedType('serialNumber', CertificateSerialNumber()),
472
+ namedtype.NamedType('signature', AlgorithmIdentifier()),
473
+ namedtype.NamedType('issuer', Name()),
474
+ namedtype.NamedType('validity', Validity()),
475
+ namedtype.NamedType('subject', Name()),
476
+ namedtype.NamedType('subjectPublicKeyInfo', SubjectPublicKeyInfo()),
477
+ namedtype.OptionalNamedType('issuerUniqueID', UniqueIdentifier().subtype(
478
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
479
+ namedtype.OptionalNamedType('subjectUniqueID', UniqueIdentifier().subtype(
480
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2))),
481
+ namedtype.OptionalNamedType('extensions',
482
+ Extensions().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 3)))
483
+ )
484
+
485
+ physical_delivery_office_name = univ.Integer(10)
486
+
487
+ ub_name = univ.Integer(32768)
488
+
489
+
490
+ class X520name(univ.Choice):
491
+ pass
492
+
493
+
494
+ X520name.componentType = namedtype.NamedTypes(
495
+ namedtype.NamedType('teletexString',
496
+ char.TeletexString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_name))),
497
+ namedtype.NamedType('printableString',
498
+ char.PrintableString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_name))),
499
+ namedtype.NamedType('universalString',
500
+ char.UniversalString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_name))),
501
+ namedtype.NamedType('utf8String',
502
+ char.UTF8String().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_name))),
503
+ namedtype.NamedType('bmpString', char.BMPString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_name)))
504
+ )
505
+
506
+ id_at_dnQualifier = _buildOid(id_at, 46)
507
+
508
+ ub_serial_number = univ.Integer(64)
509
+
510
+ ub_pseudonym = univ.Integer(128)
511
+
512
+ pkcs_9 = _buildOid(1, 2, 840, 113549, 1, 9)
513
+
514
+
515
+ class X121Address(char.NumericString):
516
+ pass
517
+
518
+
519
+ X121Address.subtypeSpec = constraint.ValueSizeConstraint(1, ub_x121_address_length)
520
+
521
+
522
+ class NetworkAddress(X121Address):
523
+ pass
524
+
525
+
526
+ ub_integer_options = univ.Integer(256)
527
+
528
+ id_at_commonName = _buildOid(id_at, 3)
529
+
530
+ ub_organization_name_length = univ.Integer(64)
531
+
532
+ id_ad_ocsp = _buildOid(id_ad, 1)
533
+
534
+ ub_country_name_numeric_length = univ.Integer(3)
535
+
536
+ ub_country_name_alpha_length = univ.Integer(2)
537
+
538
+
539
+ class PhysicalDeliveryCountryName(univ.Choice):
540
+ pass
541
+
542
+
543
+ PhysicalDeliveryCountryName.componentType = namedtype.NamedTypes(
544
+ namedtype.NamedType('x121-dcc-code', char.NumericString().subtype(
545
+ subtypeSpec=constraint.ValueSizeConstraint(ub_country_name_numeric_length, ub_country_name_numeric_length))),
546
+ namedtype.NamedType('iso-3166-alpha2-code', char.PrintableString().subtype(
547
+ subtypeSpec=constraint.ValueSizeConstraint(ub_country_name_alpha_length, ub_country_name_alpha_length)))
548
+ )
549
+
550
+ id_emailAddress = _buildOid(pkcs_9, 1)
551
+
552
+ common_name = univ.Integer(1)
553
+
554
+
555
+ class X520Pseudonym(univ.Choice):
556
+ pass
557
+
558
+
559
+ X520Pseudonym.componentType = namedtype.NamedTypes(
560
+ namedtype.NamedType('teletexString',
561
+ char.TeletexString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_pseudonym))),
562
+ namedtype.NamedType('printableString',
563
+ char.PrintableString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_pseudonym))),
564
+ namedtype.NamedType('universalString',
565
+ char.UniversalString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_pseudonym))),
566
+ namedtype.NamedType('utf8String',
567
+ char.UTF8String().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_pseudonym))),
568
+ namedtype.NamedType('bmpString',
569
+ char.BMPString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_pseudonym)))
570
+ )
571
+
572
+ ub_domain_name_length = univ.Integer(16)
573
+
574
+
575
+ class AdministrationDomainName(univ.Choice):
576
+ pass
577
+
578
+
579
+ AdministrationDomainName.tagSet = univ.Choice.tagSet.tagExplicitly(
580
+ tag.Tag(tag.tagClassApplication, tag.tagFormatConstructed, 2))
581
+ AdministrationDomainName.componentType = namedtype.NamedTypes(
582
+ namedtype.NamedType('numeric', char.NumericString().subtype(
583
+ subtypeSpec=constraint.ValueSizeConstraint(0, ub_domain_name_length))),
584
+ namedtype.NamedType('printable', char.PrintableString().subtype(
585
+ subtypeSpec=constraint.ValueSizeConstraint(0, ub_domain_name_length)))
586
+ )
587
+
588
+
589
+ class PresentationAddress(univ.Sequence):
590
+ pass
591
+
592
+
593
+ PresentationAddress.componentType = namedtype.NamedTypes(
594
+ namedtype.OptionalNamedType('pSelector', univ.OctetString().subtype(
595
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
596
+ namedtype.OptionalNamedType('sSelector', univ.OctetString().subtype(
597
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
598
+ namedtype.OptionalNamedType('tSelector', univ.OctetString().subtype(
599
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2))),
600
+ namedtype.NamedType('nAddresses', univ.SetOf(componentType=univ.OctetString()).subtype(
601
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 3)))
602
+ )
603
+
604
+
605
+ class ExtendedNetworkAddress(univ.Choice):
606
+ pass
607
+
608
+
609
+ ExtendedNetworkAddress.componentType = namedtype.NamedTypes(
610
+ namedtype.NamedType(
611
+ 'e163-4-address', univ.Sequence(
612
+ componentType=namedtype.NamedTypes(
613
+ namedtype.NamedType('number', char.NumericString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_e163_4_number_length)).subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
614
+ namedtype.OptionalNamedType('sub-address', char.NumericString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_e163_4_sub_address_length)).subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)))
615
+ )
616
+ )
617
+ ),
618
+ namedtype.NamedType('psap-address', PresentationAddress().subtype(
619
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0)))
620
+ )
621
+
622
+
623
+ class TeletexOrganizationName(char.TeletexString):
624
+ pass
625
+
626
+
627
+ TeletexOrganizationName.subtypeSpec = constraint.ValueSizeConstraint(1, ub_organization_name_length)
628
+
629
+ ub_terminal_id_length = univ.Integer(24)
630
+
631
+
632
+ class TerminalIdentifier(char.PrintableString):
633
+ pass
634
+
635
+
636
+ TerminalIdentifier.subtypeSpec = constraint.ValueSizeConstraint(1, ub_terminal_id_length)
637
+
638
+ id_ad_caIssuers = _buildOid(id_ad, 2)
639
+
640
+ id_at_countryName = _buildOid(id_at, 6)
641
+
642
+
643
+ class StreetAddress(PDSParameter):
644
+ pass
645
+
646
+
647
+ postal_code = univ.Integer(9)
648
+
649
+ id_at_givenName = _buildOid(id_at, 42)
650
+
651
+ ub_title = univ.Integer(64)
652
+
653
+
654
+ class ExtensionAttributes(univ.SetOf):
655
+ pass
656
+
657
+
658
+ ExtensionAttributes.componentType = ExtensionAttribute()
659
+ ExtensionAttributes.sizeSpec = constraint.ValueSizeConstraint(1, ub_extension_attributes)
660
+
661
+ ub_emailaddress_length = univ.Integer(255)
662
+
663
+ id_ad_caRepository = _buildOid(id_ad, 5)
664
+
665
+
666
+ class ExtensionORAddressComponents(PDSParameter):
667
+ pass
668
+
669
+
670
+ ub_organizational_unit_name = univ.Integer(64)
671
+
672
+
673
+ class X520OrganizationalUnitName(univ.Choice):
674
+ pass
675
+
676
+
677
+ X520OrganizationalUnitName.componentType = namedtype.NamedTypes(
678
+ namedtype.NamedType('teletexString', char.TeletexString().subtype(
679
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_organizational_unit_name))),
680
+ namedtype.NamedType('printableString', char.PrintableString().subtype(
681
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_organizational_unit_name))),
682
+ namedtype.NamedType('universalString', char.UniversalString().subtype(
683
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_organizational_unit_name))),
684
+ namedtype.NamedType('utf8String', char.UTF8String().subtype(
685
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_organizational_unit_name))),
686
+ namedtype.NamedType('bmpString', char.BMPString().subtype(
687
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_organizational_unit_name)))
688
+ )
689
+
690
+
691
+ class LocalPostalAttributes(PDSParameter):
692
+ pass
693
+
694
+
695
+ teletex_organizational_unit_names = univ.Integer(5)
696
+
697
+
698
+ class X520Title(univ.Choice):
699
+ pass
700
+
701
+
702
+ X520Title.componentType = namedtype.NamedTypes(
703
+ namedtype.NamedType('teletexString',
704
+ char.TeletexString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_title))),
705
+ namedtype.NamedType('printableString',
706
+ char.PrintableString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_title))),
707
+ namedtype.NamedType('universalString',
708
+ char.UniversalString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_title))),
709
+ namedtype.NamedType('utf8String',
710
+ char.UTF8String().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_title))),
711
+ namedtype.NamedType('bmpString', char.BMPString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_title)))
712
+ )
713
+
714
+ id_at_localityName = _buildOid(id_at, 7)
715
+
716
+ id_at_initials = _buildOid(id_at, 43)
717
+
718
+ ub_state_name = univ.Integer(128)
719
+
720
+
721
+ class X520StateOrProvinceName(univ.Choice):
722
+ pass
723
+
724
+
725
+ X520StateOrProvinceName.componentType = namedtype.NamedTypes(
726
+ namedtype.NamedType('teletexString',
727
+ char.TeletexString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_state_name))),
728
+ namedtype.NamedType('printableString',
729
+ char.PrintableString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_state_name))),
730
+ namedtype.NamedType('universalString',
731
+ char.UniversalString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_state_name))),
732
+ namedtype.NamedType('utf8String',
733
+ char.UTF8String().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_state_name))),
734
+ namedtype.NamedType('bmpString',
735
+ char.BMPString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_state_name)))
736
+ )
737
+
738
+ physical_delivery_organization_name = univ.Integer(14)
739
+
740
+ id_at_surname = _buildOid(id_at, 4)
741
+
742
+
743
+ class X520countryName(char.PrintableString):
744
+ pass
745
+
746
+
747
+ X520countryName.subtypeSpec = constraint.ValueSizeConstraint(2, 2)
748
+
749
+ physical_delivery_office_number = univ.Integer(11)
750
+
751
+ id_qt_unotice = _buildOid(id_qt, 2)
752
+
753
+
754
+ class X520SerialNumber(char.PrintableString):
755
+ pass
756
+
757
+
758
+ X520SerialNumber.subtypeSpec = constraint.ValueSizeConstraint(1, ub_serial_number)
759
+
760
+
761
+ class Attribute(univ.Sequence):
762
+ componentType = namedtype.NamedTypes(
763
+ namedtype.NamedType('type', AttributeType()),
764
+ namedtype.NamedType('values',
765
+ univ.SetOf(componentType=AttributeValue()),
766
+ openType=opentype.OpenType('type', certificateAttributesMap))
767
+ )
768
+
769
+ ub_common_name = univ.Integer(64)
770
+
771
+ id_pe = _buildOid(id_pkix, 1)
772
+
773
+
774
+ class ExtensionPhysicalDeliveryAddressComponents(PDSParameter):
775
+ pass
776
+
777
+
778
+ class EmailAddress(char.IA5String):
779
+ pass
780
+
781
+
782
+ EmailAddress.subtypeSpec = constraint.ValueSizeConstraint(1, ub_emailaddress_length)
783
+
784
+ id_at_organizationName = _buildOid(id_at, 10)
785
+
786
+ post_office_box_address = univ.Integer(18)
787
+
788
+
789
+ class BuiltInDomainDefinedAttribute(univ.Sequence):
790
+ pass
791
+
792
+
793
+ BuiltInDomainDefinedAttribute.componentType = namedtype.NamedTypes(
794
+ namedtype.NamedType('type', char.PrintableString().subtype(
795
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_domain_defined_attribute_type_length))),
796
+ namedtype.NamedType('value', char.PrintableString().subtype(
797
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_domain_defined_attribute_value_length)))
798
+ )
799
+
800
+
801
+ class BuiltInDomainDefinedAttributes(univ.SequenceOf):
802
+ pass
803
+
804
+
805
+ BuiltInDomainDefinedAttributes.componentType = BuiltInDomainDefinedAttribute()
806
+ BuiltInDomainDefinedAttributes.sizeSpec = constraint.ValueSizeConstraint(1, ub_domain_defined_attributes)
807
+
808
+ id_at_pseudonym = _buildOid(id_at, 65)
809
+
810
+ id_domainComponent = _buildOid(0, 9, 2342, 19200300, 100, 1, 25)
811
+
812
+
813
+ class X520CommonName(univ.Choice):
814
+ pass
815
+
816
+
817
+ X520CommonName.componentType = namedtype.NamedTypes(
818
+ namedtype.NamedType('teletexString',
819
+ char.TeletexString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_common_name))),
820
+ namedtype.NamedType('printableString',
821
+ char.PrintableString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_common_name))),
822
+ namedtype.NamedType('universalString',
823
+ char.UniversalString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_common_name))),
824
+ namedtype.NamedType('utf8String',
825
+ char.UTF8String().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_common_name))),
826
+ namedtype.NamedType('bmpString',
827
+ char.BMPString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_common_name)))
828
+ )
829
+
830
+ extension_OR_address_components = univ.Integer(12)
831
+
832
+ ub_organizational_units = univ.Integer(4)
833
+
834
+ teletex_personal_name = univ.Integer(4)
835
+
836
+ ub_numeric_user_id_length = univ.Integer(32)
837
+
838
+ ub_common_name_length = univ.Integer(64)
839
+
840
+
841
+ class TeletexCommonName(char.TeletexString):
842
+ pass
843
+
844
+
845
+ TeletexCommonName.subtypeSpec = constraint.ValueSizeConstraint(1, ub_common_name_length)
846
+
847
+
848
+ class PhysicalDeliveryOrganizationName(PDSParameter):
849
+ pass
850
+
851
+
852
+ extension_physical_delivery_address_components = univ.Integer(15)
853
+
854
+
855
+ class NumericUserIdentifier(char.NumericString):
856
+ pass
857
+
858
+
859
+ NumericUserIdentifier.subtypeSpec = constraint.ValueSizeConstraint(1, ub_numeric_user_id_length)
860
+
861
+
862
+ class CountryName(univ.Choice):
863
+ pass
864
+
865
+
866
+ CountryName.tagSet = univ.Choice.tagSet.tagExplicitly(tag.Tag(tag.tagClassApplication, tag.tagFormatConstructed, 1))
867
+ CountryName.componentType = namedtype.NamedTypes(
868
+ namedtype.NamedType('x121-dcc-code', char.NumericString().subtype(
869
+ subtypeSpec=constraint.ValueSizeConstraint(ub_country_name_numeric_length, ub_country_name_numeric_length))),
870
+ namedtype.NamedType('iso-3166-alpha2-code', char.PrintableString().subtype(
871
+ subtypeSpec=constraint.ValueSizeConstraint(ub_country_name_alpha_length, ub_country_name_alpha_length)))
872
+ )
873
+
874
+
875
+ class OrganizationName(char.PrintableString):
876
+ pass
877
+
878
+
879
+ OrganizationName.subtypeSpec = constraint.ValueSizeConstraint(1, ub_organization_name_length)
880
+
881
+
882
+ class OrganizationalUnitNames(univ.SequenceOf):
883
+ pass
884
+
885
+
886
+ OrganizationalUnitNames.componentType = OrganizationalUnitName()
887
+ OrganizationalUnitNames.sizeSpec = constraint.ValueSizeConstraint(1, ub_organizational_units)
888
+
889
+
890
+ class PrivateDomainName(univ.Choice):
891
+ pass
892
+
893
+
894
+ PrivateDomainName.componentType = namedtype.NamedTypes(
895
+ namedtype.NamedType('numeric', char.NumericString().subtype(
896
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_domain_name_length))),
897
+ namedtype.NamedType('printable', char.PrintableString().subtype(
898
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_domain_name_length)))
899
+ )
900
+
901
+
902
+ class BuiltInStandardAttributes(univ.Sequence):
903
+ pass
904
+
905
+
906
+ BuiltInStandardAttributes.componentType = namedtype.NamedTypes(
907
+ namedtype.OptionalNamedType('country-name', CountryName()),
908
+ namedtype.OptionalNamedType('administration-domain-name', AdministrationDomainName()),
909
+ namedtype.OptionalNamedType('network-address', NetworkAddress().subtype(
910
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
911
+ namedtype.OptionalNamedType('terminal-identifier', TerminalIdentifier().subtype(
912
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
913
+ namedtype.OptionalNamedType('private-domain-name', PrivateDomainName().subtype(
914
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 2))),
915
+ namedtype.OptionalNamedType('organization-name', OrganizationName().subtype(
916
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 3))),
917
+ namedtype.OptionalNamedType('numeric-user-identifier', NumericUserIdentifier().subtype(
918
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 4))),
919
+ namedtype.OptionalNamedType('personal-name', PersonalName().subtype(
920
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 5))),
921
+ namedtype.OptionalNamedType('organizational-unit-names', OrganizationalUnitNames().subtype(
922
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 6)))
923
+ )
924
+
925
+
926
+ class ORAddress(univ.Sequence):
927
+ pass
928
+
929
+
930
+ ORAddress.componentType = namedtype.NamedTypes(
931
+ namedtype.NamedType('built-in-standard-attributes', BuiltInStandardAttributes()),
932
+ namedtype.OptionalNamedType('built-in-domain-defined-attributes', BuiltInDomainDefinedAttributes()),
933
+ namedtype.OptionalNamedType('extension-attributes', ExtensionAttributes())
934
+ )
935
+
936
+
937
+ class DistinguishedName(RDNSequence):
938
+ pass
939
+
940
+
941
+ id_ad_timeStamping = _buildOid(id_ad, 3)
942
+
943
+
944
+ class PhysicalDeliveryOfficeNumber(PDSParameter):
945
+ pass
946
+
947
+
948
+ teletex_domain_defined_attributes = univ.Integer(6)
949
+
950
+
951
+ class UniquePostalName(PDSParameter):
952
+ pass
953
+
954
+
955
+ physical_delivery_country_name = univ.Integer(8)
956
+
957
+ ub_pds_name_length = univ.Integer(16)
958
+
959
+
960
+ class PDSName(char.PrintableString):
961
+ pass
962
+
963
+
964
+ PDSName.subtypeSpec = constraint.ValueSizeConstraint(1, ub_pds_name_length)
965
+
966
+
967
+ class TeletexPersonalName(univ.Set):
968
+ pass
969
+
970
+
971
+ TeletexPersonalName.componentType = namedtype.NamedTypes(
972
+ namedtype.NamedType('surname', char.TeletexString().subtype(
973
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_surname_length)).subtype(
974
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
975
+ namedtype.OptionalNamedType('given-name', char.TeletexString().subtype(
976
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_given_name_length)).subtype(
977
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
978
+ namedtype.OptionalNamedType('initials', char.TeletexString().subtype(
979
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_initials_length)).subtype(
980
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2))),
981
+ namedtype.OptionalNamedType('generation-qualifier', char.TeletexString().subtype(
982
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_generation_qualifier_length)).subtype(
983
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 3)))
984
+ )
985
+
986
+ street_address = univ.Integer(17)
987
+
988
+
989
+ class PostOfficeBoxAddress(PDSParameter):
990
+ pass
991
+
992
+
993
+ local_postal_attributes = univ.Integer(21)
994
+
995
+
996
+ class DirectoryString(univ.Choice):
997
+ pass
998
+
999
+
1000
+ DirectoryString.componentType = namedtype.NamedTypes(
1001
+ namedtype.NamedType('teletexString',
1002
+ char.TeletexString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, MAX))),
1003
+ namedtype.NamedType('printableString',
1004
+ char.PrintableString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, MAX))),
1005
+ namedtype.NamedType('universalString',
1006
+ char.UniversalString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, MAX))),
1007
+ namedtype.NamedType('utf8String', char.UTF8String().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, MAX))),
1008
+ namedtype.NamedType('bmpString', char.BMPString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, MAX)))
1009
+ )
1010
+
1011
+ teletex_common_name = univ.Integer(2)
1012
+
1013
+
1014
+ class CommonName(char.PrintableString):
1015
+ pass
1016
+
1017
+
1018
+ CommonName.subtypeSpec = constraint.ValueSizeConstraint(1, ub_common_name_length)
1019
+
1020
+
1021
+ class Certificate(univ.Sequence):
1022
+ pass
1023
+
1024
+
1025
+ Certificate.componentType = namedtype.NamedTypes(
1026
+ namedtype.NamedType('tbsCertificate', TBSCertificate()),
1027
+ namedtype.NamedType('signatureAlgorithm', AlgorithmIdentifier()),
1028
+ namedtype.NamedType('signature', univ.BitString())
1029
+ )
1030
+
1031
+
1032
+ class TeletexOrganizationalUnitName(char.TeletexString):
1033
+ pass
1034
+
1035
+
1036
+ TeletexOrganizationalUnitName.subtypeSpec = constraint.ValueSizeConstraint(1, ub_organizational_unit_name_length)
1037
+
1038
+ id_at_name = _buildOid(id_at, 41)
1039
+
1040
+
1041
+ class TeletexOrganizationalUnitNames(univ.SequenceOf):
1042
+ pass
1043
+
1044
+
1045
+ TeletexOrganizationalUnitNames.componentType = TeletexOrganizationalUnitName()
1046
+ TeletexOrganizationalUnitNames.sizeSpec = constraint.ValueSizeConstraint(1, ub_organizational_units)
1047
+
1048
+ id_ce = _buildOid(2, 5, 29)
1049
+
1050
+ id_ce_issuerAltName = _buildOid(id_ce, 18)
1051
+
1052
+
1053
+ class SkipCerts(univ.Integer):
1054
+ pass
1055
+
1056
+
1057
+ SkipCerts.subtypeSpec = constraint.ValueRangeConstraint(0, MAX)
1058
+
1059
+
1060
+ class CRLReason(univ.Enumerated):
1061
+ pass
1062
+
1063
+
1064
+ CRLReason.namedValues = namedval.NamedValues(
1065
+ ('unspecified', 0),
1066
+ ('keyCompromise', 1),
1067
+ ('cACompromise', 2),
1068
+ ('affiliationChanged', 3),
1069
+ ('superseded', 4),
1070
+ ('cessationOfOperation', 5),
1071
+ ('certificateHold', 6),
1072
+ ('removeFromCRL', 8),
1073
+ ('privilegeWithdrawn', 9),
1074
+ ('aACompromise', 10)
1075
+ )
1076
+
1077
+
1078
+ class PrivateKeyUsagePeriod(univ.Sequence):
1079
+ pass
1080
+
1081
+
1082
+ PrivateKeyUsagePeriod.componentType = namedtype.NamedTypes(
1083
+ namedtype.OptionalNamedType('notBefore', useful.GeneralizedTime().subtype(
1084
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
1085
+ namedtype.OptionalNamedType('notAfter', useful.GeneralizedTime().subtype(
1086
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)))
1087
+ )
1088
+
1089
+
1090
+ class AnotherName(univ.Sequence):
1091
+ componentType = namedtype.NamedTypes(
1092
+ namedtype.NamedType('type-id', univ.ObjectIdentifier()),
1093
+ namedtype.NamedType(
1094
+ 'value',
1095
+ univ.Any().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0)),
1096
+ openType=opentype.OpenType('type-id', otherNamesMap)
1097
+ )
1098
+ )
1099
+
1100
+
1101
+ class EDIPartyName(univ.Sequence):
1102
+ pass
1103
+
1104
+
1105
+ EDIPartyName.componentType = namedtype.NamedTypes(
1106
+ namedtype.OptionalNamedType('nameAssigner', DirectoryString().subtype(
1107
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0))),
1108
+ namedtype.NamedType('partyName', DirectoryString().subtype(
1109
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 1)))
1110
+ )
1111
+
1112
+
1113
+ class GeneralName(univ.Choice):
1114
+ pass
1115
+
1116
+
1117
+ GeneralName.componentType = namedtype.NamedTypes(
1118
+ namedtype.NamedType('otherName',
1119
+ AnotherName().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0))),
1120
+ namedtype.NamedType('rfc822Name',
1121
+ char.IA5String().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
1122
+ namedtype.NamedType('dNSName',
1123
+ char.IA5String().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2))),
1124
+ namedtype.NamedType('x400Address',
1125
+ ORAddress().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 3))),
1126
+ namedtype.NamedType('directoryName',
1127
+ Name().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 4))),
1128
+ namedtype.NamedType('ediPartyName',
1129
+ EDIPartyName().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 5))),
1130
+ namedtype.NamedType('uniformResourceIdentifier',
1131
+ char.IA5String().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 6))),
1132
+ namedtype.NamedType('iPAddress',
1133
+ univ.OctetString().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 7))),
1134
+ namedtype.NamedType('registeredID', univ.ObjectIdentifier().subtype(
1135
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 8)))
1136
+ )
1137
+
1138
+
1139
+ class BaseDistance(univ.Integer):
1140
+ pass
1141
+
1142
+
1143
+ BaseDistance.subtypeSpec = constraint.ValueRangeConstraint(0, MAX)
1144
+
1145
+
1146
+ class GeneralSubtree(univ.Sequence):
1147
+ pass
1148
+
1149
+
1150
+ GeneralSubtree.componentType = namedtype.NamedTypes(
1151
+ namedtype.NamedType('base', GeneralName()),
1152
+ namedtype.DefaultedNamedType('minimum', BaseDistance().subtype(
1153
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0)).subtype(value=0)),
1154
+ namedtype.OptionalNamedType('maximum', BaseDistance().subtype(
1155
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)))
1156
+ )
1157
+
1158
+
1159
+ class GeneralNames(univ.SequenceOf):
1160
+ pass
1161
+
1162
+
1163
+ GeneralNames.componentType = GeneralName()
1164
+ GeneralNames.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
1165
+
1166
+
1167
+ class DistributionPointName(univ.Choice):
1168
+ pass
1169
+
1170
+
1171
+ DistributionPointName.componentType = namedtype.NamedTypes(
1172
+ namedtype.NamedType('fullName',
1173
+ GeneralNames().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
1174
+ namedtype.NamedType('nameRelativeToCRLIssuer', RelativeDistinguishedName().subtype(
1175
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)))
1176
+ )
1177
+
1178
+
1179
+ class ReasonFlags(univ.BitString):
1180
+ pass
1181
+
1182
+
1183
+ ReasonFlags.namedValues = namedval.NamedValues(
1184
+ ('unused', 0),
1185
+ ('keyCompromise', 1),
1186
+ ('cACompromise', 2),
1187
+ ('affiliationChanged', 3),
1188
+ ('superseded', 4),
1189
+ ('cessationOfOperation', 5),
1190
+ ('certificateHold', 6),
1191
+ ('privilegeWithdrawn', 7),
1192
+ ('aACompromise', 8)
1193
+ )
1194
+
1195
+
1196
+ class IssuingDistributionPoint(univ.Sequence):
1197
+ pass
1198
+
1199
+
1200
+ IssuingDistributionPoint.componentType = namedtype.NamedTypes(
1201
+ namedtype.OptionalNamedType('distributionPoint', DistributionPointName().subtype(
1202
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0))),
1203
+ namedtype.DefaultedNamedType('onlyContainsUserCerts', univ.Boolean().subtype(
1204
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)).subtype(value=0)),
1205
+ namedtype.DefaultedNamedType('onlyContainsCACerts', univ.Boolean().subtype(
1206
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2)).subtype(value=0)),
1207
+ namedtype.OptionalNamedType('onlySomeReasons', ReasonFlags().subtype(
1208
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 3))),
1209
+ namedtype.DefaultedNamedType('indirectCRL', univ.Boolean().subtype(
1210
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 4)).subtype(value=0)),
1211
+ namedtype.DefaultedNamedType('onlyContainsAttributeCerts', univ.Boolean().subtype(
1212
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 5)).subtype(value=0))
1213
+ )
1214
+
1215
+ id_ce_certificatePolicies = _buildOid(id_ce, 32)
1216
+
1217
+ id_kp_emailProtection = _buildOid(id_kp, 4)
1218
+
1219
+
1220
+ class AccessDescription(univ.Sequence):
1221
+ pass
1222
+
1223
+
1224
+ AccessDescription.componentType = namedtype.NamedTypes(
1225
+ namedtype.NamedType('accessMethod', univ.ObjectIdentifier()),
1226
+ namedtype.NamedType('accessLocation', GeneralName())
1227
+ )
1228
+
1229
+
1230
+ class IssuerAltName(GeneralNames):
1231
+ pass
1232
+
1233
+
1234
+ id_ce_cRLDistributionPoints = _buildOid(id_ce, 31)
1235
+
1236
+ holdInstruction = _buildOid(2, 2, 840, 10040, 2)
1237
+
1238
+ id_holdinstruction_callissuer = _buildOid(holdInstruction, 2)
1239
+
1240
+ id_ce_subjectDirectoryAttributes = _buildOid(id_ce, 9)
1241
+
1242
+ id_ce_issuingDistributionPoint = _buildOid(id_ce, 28)
1243
+
1244
+
1245
+ class DistributionPoint(univ.Sequence):
1246
+ pass
1247
+
1248
+
1249
+ DistributionPoint.componentType = namedtype.NamedTypes(
1250
+ namedtype.OptionalNamedType('distributionPoint', DistributionPointName().subtype(
1251
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0))),
1252
+ namedtype.OptionalNamedType('reasons', ReasonFlags().subtype(
1253
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
1254
+ namedtype.OptionalNamedType('cRLIssuer', GeneralNames().subtype(
1255
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2)))
1256
+ )
1257
+
1258
+
1259
+ class CRLDistributionPoints(univ.SequenceOf):
1260
+ pass
1261
+
1262
+
1263
+ CRLDistributionPoints.componentType = DistributionPoint()
1264
+ CRLDistributionPoints.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
1265
+
1266
+
1267
+ class GeneralSubtrees(univ.SequenceOf):
1268
+ pass
1269
+
1270
+
1271
+ GeneralSubtrees.componentType = GeneralSubtree()
1272
+ GeneralSubtrees.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
1273
+
1274
+
1275
+ class NameConstraints(univ.Sequence):
1276
+ pass
1277
+
1278
+
1279
+ NameConstraints.componentType = namedtype.NamedTypes(
1280
+ namedtype.OptionalNamedType('permittedSubtrees', GeneralSubtrees().subtype(
1281
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
1282
+ namedtype.OptionalNamedType('excludedSubtrees', GeneralSubtrees().subtype(
1283
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)))
1284
+ )
1285
+
1286
+
1287
+ class SubjectDirectoryAttributes(univ.SequenceOf):
1288
+ pass
1289
+
1290
+
1291
+ SubjectDirectoryAttributes.componentType = Attribute()
1292
+ SubjectDirectoryAttributes.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
1293
+
1294
+ id_kp_OCSPSigning = _buildOid(id_kp, 9)
1295
+
1296
+ id_kp_timeStamping = _buildOid(id_kp, 8)
1297
+
1298
+
1299
+ class DisplayText(univ.Choice):
1300
+ pass
1301
+
1302
+
1303
+ DisplayText.componentType = namedtype.NamedTypes(
1304
+ namedtype.NamedType('ia5String', char.IA5String().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, 200))),
1305
+ namedtype.NamedType('visibleString',
1306
+ char.VisibleString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, 200))),
1307
+ namedtype.NamedType('bmpString', char.BMPString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, 200))),
1308
+ namedtype.NamedType('utf8String', char.UTF8String().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, 200)))
1309
+ )
1310
+
1311
+
1312
+ class NoticeReference(univ.Sequence):
1313
+ pass
1314
+
1315
+
1316
+ NoticeReference.componentType = namedtype.NamedTypes(
1317
+ namedtype.NamedType('organization', DisplayText()),
1318
+ namedtype.NamedType('noticeNumbers', univ.SequenceOf(componentType=univ.Integer()))
1319
+ )
1320
+
1321
+
1322
+ class UserNotice(univ.Sequence):
1323
+ pass
1324
+
1325
+
1326
+ UserNotice.componentType = namedtype.NamedTypes(
1327
+ namedtype.OptionalNamedType('noticeRef', NoticeReference()),
1328
+ namedtype.OptionalNamedType('explicitText', DisplayText())
1329
+ )
1330
+
1331
+
1332
+ class PolicyQualifierId(univ.ObjectIdentifier):
1333
+ pass
1334
+
1335
+
1336
+ class PolicyQualifierInfo(univ.Sequence):
1337
+ componentType = namedtype.NamedTypes(
1338
+ namedtype.NamedType('policyQualifierId', PolicyQualifierId()),
1339
+ namedtype.NamedType(
1340
+ 'qualifier', univ.Any(),
1341
+ openType=opentype.OpenType('policyQualifierId', policyQualifierInfosMap)
1342
+ )
1343
+ )
1344
+
1345
+
1346
+ class CertPolicyId(univ.ObjectIdentifier):
1347
+ pass
1348
+
1349
+
1350
+ class PolicyInformation(univ.Sequence):
1351
+ pass
1352
+
1353
+
1354
+ PolicyInformation.componentType = namedtype.NamedTypes(
1355
+ namedtype.NamedType('policyIdentifier', CertPolicyId()),
1356
+ namedtype.OptionalNamedType('policyQualifiers', univ.SequenceOf(componentType=PolicyQualifierInfo()).subtype(subtypeSpec=constraint.ValueSizeConstraint(1, MAX)))
1357
+ )
1358
+
1359
+
1360
+ class CertificatePolicies(univ.SequenceOf):
1361
+ pass
1362
+
1363
+
1364
+ CertificatePolicies.componentType = PolicyInformation()
1365
+ CertificatePolicies.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
1366
+
1367
+
1368
+ class SubjectAltName(GeneralNames):
1369
+ pass
1370
+
1371
+
1372
+ id_ce_basicConstraints = _buildOid(id_ce, 19)
1373
+
1374
+ id_ce_authorityKeyIdentifier = _buildOid(id_ce, 35)
1375
+
1376
+ id_kp_codeSigning = _buildOid(id_kp, 3)
1377
+
1378
+
1379
+ class BasicConstraints(univ.Sequence):
1380
+ pass
1381
+
1382
+
1383
+ BasicConstraints.componentType = namedtype.NamedTypes(
1384
+ namedtype.DefaultedNamedType('cA', univ.Boolean().subtype(value=0)),
1385
+ namedtype.OptionalNamedType('pathLenConstraint',
1386
+ univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint(0, MAX)))
1387
+ )
1388
+
1389
+ id_ce_certificateIssuer = _buildOid(id_ce, 29)
1390
+
1391
+
1392
+ class PolicyMappings(univ.SequenceOf):
1393
+ pass
1394
+
1395
+
1396
+ PolicyMappings.componentType = univ.Sequence(
1397
+ componentType=namedtype.NamedTypes(
1398
+ namedtype.NamedType('issuerDomainPolicy', CertPolicyId()),
1399
+ namedtype.NamedType('subjectDomainPolicy', CertPolicyId())
1400
+ )
1401
+ )
1402
+
1403
+ PolicyMappings.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
1404
+
1405
+
1406
+ class InhibitAnyPolicy(SkipCerts):
1407
+ pass
1408
+
1409
+
1410
+ anyPolicy = _buildOid(id_ce_certificatePolicies, 0)
1411
+
1412
+
1413
+ class CRLNumber(univ.Integer):
1414
+ pass
1415
+
1416
+
1417
+ CRLNumber.subtypeSpec = constraint.ValueRangeConstraint(0, MAX)
1418
+
1419
+
1420
+ class BaseCRLNumber(CRLNumber):
1421
+ pass
1422
+
1423
+
1424
+ id_ce_nameConstraints = _buildOid(id_ce, 30)
1425
+
1426
+ id_kp_serverAuth = _buildOid(id_kp, 1)
1427
+
1428
+ id_ce_freshestCRL = _buildOid(id_ce, 46)
1429
+
1430
+ id_ce_cRLReasons = _buildOid(id_ce, 21)
1431
+
1432
+ id_ce_extKeyUsage = _buildOid(id_ce, 37)
1433
+
1434
+
1435
+ class KeyIdentifier(univ.OctetString):
1436
+ pass
1437
+
1438
+
1439
+ class AuthorityKeyIdentifier(univ.Sequence):
1440
+ pass
1441
+
1442
+
1443
+ AuthorityKeyIdentifier.componentType = namedtype.NamedTypes(
1444
+ namedtype.OptionalNamedType('keyIdentifier', KeyIdentifier().subtype(
1445
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
1446
+ namedtype.OptionalNamedType('authorityCertIssuer', GeneralNames().subtype(
1447
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
1448
+ namedtype.OptionalNamedType('authorityCertSerialNumber', CertificateSerialNumber().subtype(
1449
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2)))
1450
+ )
1451
+
1452
+
1453
+ class FreshestCRL(CRLDistributionPoints):
1454
+ pass
1455
+
1456
+
1457
+ id_ce_policyConstraints = _buildOid(id_ce, 36)
1458
+
1459
+ id_pe_authorityInfoAccess = _buildOid(id_pe, 1)
1460
+
1461
+
1462
+ class AuthorityInfoAccessSyntax(univ.SequenceOf):
1463
+ pass
1464
+
1465
+
1466
+ AuthorityInfoAccessSyntax.componentType = AccessDescription()
1467
+ AuthorityInfoAccessSyntax.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
1468
+
1469
+ id_holdinstruction_none = _buildOid(holdInstruction, 1)
1470
+
1471
+
1472
+ class CPSuri(char.IA5String):
1473
+ pass
1474
+
1475
+
1476
+ id_pe_subjectInfoAccess = _buildOid(id_pe, 11)
1477
+
1478
+
1479
+ class SubjectKeyIdentifier(KeyIdentifier):
1480
+ pass
1481
+
1482
+
1483
+ id_ce_subjectAltName = _buildOid(id_ce, 17)
1484
+
1485
+
1486
+ class KeyPurposeId(univ.ObjectIdentifier):
1487
+ pass
1488
+
1489
+
1490
+ class ExtKeyUsageSyntax(univ.SequenceOf):
1491
+ pass
1492
+
1493
+
1494
+ ExtKeyUsageSyntax.componentType = KeyPurposeId()
1495
+ ExtKeyUsageSyntax.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
1496
+
1497
+
1498
+ class HoldInstructionCode(univ.ObjectIdentifier):
1499
+ pass
1500
+
1501
+
1502
+ id_ce_deltaCRLIndicator = _buildOid(id_ce, 27)
1503
+
1504
+ id_ce_keyUsage = _buildOid(id_ce, 15)
1505
+
1506
+ id_ce_holdInstructionCode = _buildOid(id_ce, 23)
1507
+
1508
+
1509
+ class SubjectInfoAccessSyntax(univ.SequenceOf):
1510
+ pass
1511
+
1512
+
1513
+ SubjectInfoAccessSyntax.componentType = AccessDescription()
1514
+ SubjectInfoAccessSyntax.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
1515
+
1516
+
1517
+ class InvalidityDate(useful.GeneralizedTime):
1518
+ pass
1519
+
1520
+
1521
+ class KeyUsage(univ.BitString):
1522
+ pass
1523
+
1524
+
1525
+ KeyUsage.namedValues = namedval.NamedValues(
1526
+ ('digitalSignature', 0),
1527
+ ('nonRepudiation', 1),
1528
+ ('keyEncipherment', 2),
1529
+ ('dataEncipherment', 3),
1530
+ ('keyAgreement', 4),
1531
+ ('keyCertSign', 5),
1532
+ ('cRLSign', 6),
1533
+ ('encipherOnly', 7),
1534
+ ('decipherOnly', 8)
1535
+ )
1536
+
1537
+ id_ce_invalidityDate = _buildOid(id_ce, 24)
1538
+
1539
+ id_ce_policyMappings = _buildOid(id_ce, 33)
1540
+
1541
+ anyExtendedKeyUsage = _buildOid(id_ce_extKeyUsage, 0)
1542
+
1543
+ id_ce_privateKeyUsagePeriod = _buildOid(id_ce, 16)
1544
+
1545
+ id_ce_cRLNumber = _buildOid(id_ce, 20)
1546
+
1547
+
1548
+ class CertificateIssuer(GeneralNames):
1549
+ pass
1550
+
1551
+
1552
+ id_holdinstruction_reject = _buildOid(holdInstruction, 3)
1553
+
1554
+
1555
+ class PolicyConstraints(univ.Sequence):
1556
+ pass
1557
+
1558
+
1559
+ PolicyConstraints.componentType = namedtype.NamedTypes(
1560
+ namedtype.OptionalNamedType('requireExplicitPolicy',
1561
+ SkipCerts().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
1562
+ namedtype.OptionalNamedType('inhibitPolicyMapping',
1563
+ SkipCerts().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)))
1564
+ )
1565
+
1566
+ id_kp_clientAuth = _buildOid(id_kp, 2)
1567
+
1568
+ id_ce_subjectKeyIdentifier = _buildOid(id_ce, 14)
1569
+
1570
+ id_ce_inhibitAnyPolicy = _buildOid(id_ce, 54)
1571
+
1572
+
1573
+ # map of ORAddress ExtensionAttribute type to ExtensionAttribute value
1574
+
1575
+ _orAddressExtensionAttributesMapUpdate = {
1576
+ common_name: CommonName(),
1577
+ teletex_common_name: TeletexCommonName(),
1578
+ teletex_organization_name: TeletexOrganizationName(),
1579
+ teletex_personal_name: TeletexPersonalName(),
1580
+ teletex_organizational_unit_names: TeletexOrganizationalUnitNames(),
1581
+ pds_name: PDSName(),
1582
+ physical_delivery_country_name: PhysicalDeliveryCountryName(),
1583
+ postal_code: PostalCode(),
1584
+ physical_delivery_office_name: PhysicalDeliveryOfficeName(),
1585
+ physical_delivery_office_number: PhysicalDeliveryOfficeNumber(),
1586
+ extension_OR_address_components: ExtensionORAddressComponents(),
1587
+ physical_delivery_personal_name: PhysicalDeliveryPersonalName(),
1588
+ physical_delivery_organization_name: PhysicalDeliveryOrganizationName(),
1589
+ extension_physical_delivery_address_components: ExtensionPhysicalDeliveryAddressComponents(),
1590
+ unformatted_postal_address: UnformattedPostalAddress(),
1591
+ street_address: StreetAddress(),
1592
+ post_office_box_address: PostOfficeBoxAddress(),
1593
+ poste_restante_address: PosteRestanteAddress(),
1594
+ unique_postal_name: UniquePostalName(),
1595
+ local_postal_attributes: LocalPostalAttributes(),
1596
+ extended_network_address: ExtendedNetworkAddress(),
1597
+ terminal_type: TerminalType(),
1598
+ teletex_domain_defined_attributes: TeletexDomainDefinedAttributes(),
1599
+ }
1600
+
1601
+ orAddressExtensionAttributesMap.update(_orAddressExtensionAttributesMapUpdate)
1602
+
1603
+
1604
+ # map of PolicyQualifierId -> Qualifier
1605
+
1606
+ _policyQualifierInfosMapUpdate = {
1607
+ id_qt_cps: CPSuri(),
1608
+ id_qt_unotice: UserNotice(),
1609
+ }
1610
+
1611
+ policyQualifierInfosMap.update(_policyQualifierInfosMapUpdate)
1612
+
1613
+
1614
+ # map of AttributeType -> AttributeValue
1615
+
1616
+ _certificateAttributesMapUpdate = {
1617
+ id_at_name: X520name(),
1618
+ id_at_surname: X520name(),
1619
+ id_at_givenName: X520name(),
1620
+ id_at_initials: X520name(),
1621
+ id_at_generationQualifier: X520name(),
1622
+ id_at_commonName: X520CommonName(),
1623
+ id_at_localityName: X520LocalityName(),
1624
+ id_at_stateOrProvinceName: X520StateOrProvinceName(),
1625
+ id_at_organizationName: X520OrganizationName(),
1626
+ id_at_organizationalUnitName: X520OrganizationalUnitName(),
1627
+ id_at_title: X520Title(),
1628
+ id_at_dnQualifier: X520dnQualifier(),
1629
+ id_at_countryName: X520countryName(),
1630
+ id_at_serialNumber: X520SerialNumber(),
1631
+ id_at_pseudonym: X520Pseudonym(),
1632
+ id_domainComponent: DomainComponent(),
1633
+ id_emailAddress: EmailAddress(),
1634
+ }
1635
+
1636
+ certificateAttributesMap.update(_certificateAttributesMapUpdate)
1637
+
1638
+
1639
+ # map of Certificate Extension OIDs to Extensions
1640
+
1641
+ _certificateExtensionsMap = {
1642
+ id_ce_authorityKeyIdentifier: AuthorityKeyIdentifier(),
1643
+ id_ce_subjectKeyIdentifier: SubjectKeyIdentifier(),
1644
+ id_ce_keyUsage: KeyUsage(),
1645
+ id_ce_privateKeyUsagePeriod: PrivateKeyUsagePeriod(),
1646
+ id_ce_certificatePolicies: CertificatePolicies(),
1647
+ id_ce_policyMappings: PolicyMappings(),
1648
+ id_ce_subjectAltName: SubjectAltName(),
1649
+ id_ce_issuerAltName: IssuerAltName(),
1650
+ id_ce_subjectDirectoryAttributes: SubjectDirectoryAttributes(),
1651
+ id_ce_basicConstraints: BasicConstraints(),
1652
+ id_ce_nameConstraints: NameConstraints(),
1653
+ id_ce_policyConstraints: PolicyConstraints(),
1654
+ id_ce_extKeyUsage: ExtKeyUsageSyntax(),
1655
+ id_ce_cRLDistributionPoints: CRLDistributionPoints(),
1656
+ id_pe_authorityInfoAccess: AuthorityInfoAccessSyntax(),
1657
+ id_ce_cRLNumber: CRLNumber(),
1658
+ id_ce_deltaCRLIndicator: BaseCRLNumber(),
1659
+ id_ce_issuingDistributionPoint: IssuingDistributionPoint(),
1660
+ id_ce_cRLReasons: CRLReason(),
1661
+ id_ce_holdInstructionCode: univ.ObjectIdentifier(),
1662
+ id_ce_invalidityDate: useful.GeneralizedTime(),
1663
+ id_ce_certificateIssuer: GeneralNames(),
1664
+ }
1665
+
1666
+ certificateExtensionsMap.update(_certificateExtensionsMap)