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,485 @@
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 allow gost_28147_param_Z from RFC 7836.
6
+ # Modified by Russ Housley to include the opentypemap manager.
7
+ #
8
+ # Copyright (c) 2019-2024, Vigil Security, LLC
9
+ # License: http://vigilsec.com/pyasn1-alt-modules-license.txt
10
+ #
11
+ # Additional Cryptographic Algorithms for Use with GOST 28147-89,
12
+ # GOST R 34.10-94, GOST R 34.10-2001, and GOST R 34.11-94 Algorithms
13
+ #
14
+ # ASN.1 source from:
15
+ # https://www.rfc-editor.org/rfc/rfc4357.txt
16
+ # https://www.rfc-editor.org/rfc/rfc7863.txt
17
+ # https://www.rfc-editor.org/errata/eid5927
18
+ # https://www.rfc-editor.org/errata/eid5928
19
+ #
20
+
21
+ from pyasn1.type import constraint
22
+ from pyasn1.type import namedtype
23
+ from pyasn1.type import namedval
24
+ from pyasn1.type import tag
25
+ from pyasn1.type import univ
26
+
27
+ from pyasn1_alt_modules import rfc5280
28
+ from pyasn1_alt_modules import rfc7836
29
+ from pyasn1_alt_modules import opentypemap
30
+
31
+ algorithmIdentifierMap = opentypemap.get('algorithmIdentifierMap')
32
+
33
+
34
+ # Import from RFC 5280
35
+
36
+ AlgorithmIdentifier = rfc5280.AlgorithmIdentifier
37
+
38
+
39
+ # Object Identifiers
40
+
41
+ id_CryptoPro = univ.ObjectIdentifier((1, 2, 643, 2, 2,))
42
+
43
+
44
+ id_CryptoPro_modules = id_CryptoPro + (1, 1,)
45
+
46
+ id_CryptoPro_extensions = id_CryptoPro + (34,)
47
+
48
+ id_CryptoPro_policyIds = id_CryptoPro + (38,)
49
+
50
+ id_CryptoPro_policyQt = id_CryptoPro + (39,)
51
+
52
+
53
+ cryptographic_Gost_Useful_Definitions = id_CryptoPro_modules + (0, 1,)
54
+
55
+ gostR3411_94_DigestSyntax = id_CryptoPro_modules + (1, 1,)
56
+
57
+ gostR3410_94_PKISyntax = id_CryptoPro_modules + (2, 1,)
58
+
59
+ gostR3410_94_SignatureSyntax = id_CryptoPro_modules + (3, 1,)
60
+
61
+ gost28147_89_EncryptionSyntax = id_CryptoPro_modules + (4, 1,)
62
+
63
+ gostR3410_EncryptionSyntax = id_CryptoPro_modules + (5, 2,)
64
+
65
+ gost28147_89_ParamSetSyntax = id_CryptoPro_modules + (6, 1,)
66
+
67
+ gostR3411_94_ParamSetSyntax = id_CryptoPro_modules + (7, 1,)
68
+
69
+ gostR3410_94_ParamSetSyntax = id_CryptoPro_modules + (8, 1, 1)
70
+
71
+ gostR3410_2001_PKISyntax = id_CryptoPro_modules + (9, 1,)
72
+
73
+ gostR3410_2001_SignatureSyntax = id_CryptoPro_modules + (10, 1,)
74
+
75
+ gostR3410_2001_ParamSetSyntax = id_CryptoPro_modules + (12, 1,)
76
+
77
+ gost_CryptoPro_ExtendedKeyUsage = id_CryptoPro_modules + (13, 1,)
78
+
79
+ gost_CryptoPro_PrivateKey = id_CryptoPro_modules + (14, 1,)
80
+
81
+ gost_CryptoPro_PKIXCMP = id_CryptoPro_modules + (15, 1,)
82
+
83
+ gost_CryptoPro_TLS = id_CryptoPro_modules + (16, 1,)
84
+
85
+ gost_CryptoPro_Policy = id_CryptoPro_modules + (17, 1,)
86
+
87
+ gost_CryptoPro_Constants = id_CryptoPro_modules + (18, 1,)
88
+
89
+
90
+ id_CryptoPro_algorithms = id_CryptoPro
91
+
92
+ id_GostR3411_94_with_GostR3410_2001 = id_CryptoPro_algorithms + (3,)
93
+
94
+ id_GostR3411_94_with_GostR3410_94 = id_CryptoPro_algorithms + (4,)
95
+
96
+ id_GostR3411_94 = id_CryptoPro_algorithms + (9,)
97
+
98
+ id_Gost28147_89_None_KeyMeshing = id_CryptoPro_algorithms + (14, 0,)
99
+
100
+ id_Gost28147_89_CryptoPro_KeyMeshing = id_CryptoPro_algorithms + (14, 1,)
101
+
102
+ id_GostR3410_2001 = id_CryptoPro_algorithms + (19,)
103
+
104
+ id_GostR3410_94 = id_CryptoPro_algorithms + (20,)
105
+
106
+ id_Gost28147_89 = id_CryptoPro_algorithms + (21,)
107
+
108
+ id_Gost28147_89_MAC = id_CryptoPro_algorithms + (22,)
109
+
110
+ id_CryptoPro_hashes = id_CryptoPro_algorithms + (30,)
111
+
112
+ id_CryptoPro_encrypts = id_CryptoPro_algorithms + (31,)
113
+
114
+ id_CryptoPro_signs = id_CryptoPro_algorithms + (32,)
115
+
116
+ id_CryptoPro_exchanges = id_CryptoPro_algorithms + (33,)
117
+
118
+ id_CryptoPro_ecc_signs = id_CryptoPro_algorithms + (35,)
119
+
120
+ id_CryptoPro_ecc_exchanges = id_CryptoPro_algorithms + (36,)
121
+
122
+ id_CryptoPro_private_keys = id_CryptoPro_algorithms + (37,)
123
+
124
+ id_CryptoPro_pkixcmp_infos = id_CryptoPro_algorithms + (41,)
125
+
126
+ id_CryptoPro_audit_service_types = id_CryptoPro_algorithms + (42,)
127
+
128
+ id_CryptoPro_audit_record_types = id_CryptoPro_algorithms + (43,)
129
+
130
+ id_CryptoPro_attributes = id_CryptoPro_algorithms + (44,)
131
+
132
+ id_CryptoPro_name_service_types = id_CryptoPro_algorithms + (45,)
133
+
134
+ id_GostR3410_2001DH = id_CryptoPro_algorithms + (98,)
135
+
136
+ id_GostR3410_94DH = id_CryptoPro_algorithms + (99,)
137
+
138
+
139
+ id_Gost28147_89_TestParamSet = id_CryptoPro_encrypts + (0,)
140
+
141
+ id_Gost28147_89_CryptoPro_A_ParamSet = id_CryptoPro_encrypts + (1,)
142
+
143
+ id_Gost28147_89_CryptoPro_B_ParamSet = id_CryptoPro_encrypts + (2,)
144
+
145
+ id_Gost28147_89_CryptoPro_C_ParamSet = id_CryptoPro_encrypts + (3,)
146
+
147
+ id_Gost28147_89_CryptoPro_D_ParamSet = id_CryptoPro_encrypts + (4,)
148
+
149
+ id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet = id_CryptoPro_encrypts + (5,)
150
+
151
+ id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet = id_CryptoPro_encrypts + (6,)
152
+
153
+ id_Gost28147_89_CryptoPro_RIC_1_ParamSet = id_CryptoPro_encrypts + (7,)
154
+
155
+
156
+ id_GostR3410_2001_TestParamSet = id_CryptoPro_ecc_signs + (0,)
157
+
158
+ id_GostR3410_2001_CryptoPro_A_ParamSet = id_CryptoPro_ecc_signs + (1,)
159
+
160
+ id_GostR3410_2001_CryptoPro_B_ParamSet = id_CryptoPro_ecc_signs + (2,)
161
+
162
+ id_GostR3410_2001_CryptoPro_C_ParamSet = id_CryptoPro_ecc_signs + (3,)
163
+
164
+
165
+ id_GostR3410_2001_CryptoPro_XchA_ParamSet = id_CryptoPro_ecc_exchanges + (0,)
166
+
167
+ id_GostR3410_2001_CryptoPro_XchB_ParamSet = id_CryptoPro_ecc_exchanges + (1,)
168
+
169
+
170
+ id_GostR3410_94_TestParamSet = id_CryptoPro_signs + (0,)
171
+
172
+ id_GostR3410_94_CryptoPro_A_ParamSet = id_CryptoPro_signs + (2,)
173
+
174
+ id_GostR3410_94_CryptoPro_B_ParamSet = id_CryptoPro_signs + (3,)
175
+
176
+ id_GostR3410_94_CryptoPro_C_ParamSet = id_CryptoPro_signs + (4,)
177
+
178
+ id_GostR3410_94_CryptoPro_D_ParamSet = id_CryptoPro_signs + (5,)
179
+
180
+
181
+ id_GostR3410_94_CryptoPro_XchA_ParamSet = id_CryptoPro_exchanges + (1,)
182
+
183
+ id_GostR3410_94_CryptoPro_XchB_ParamSet = id_CryptoPro_exchanges + (2,)
184
+
185
+ id_GostR3410_94_CryptoPro_XchC_ParamSet = id_CryptoPro_exchanges + (3,)
186
+
187
+
188
+ id_GostR3410_94_a = id_GostR3410_94 + (1,)
189
+
190
+ id_GostR3410_94_aBis = id_GostR3410_94 + (2,)
191
+
192
+ id_GostR3410_94_b = id_GostR3410_94 + (3,)
193
+
194
+ id_GostR3410_94_bBis = id_GostR3410_94 + (4,)
195
+
196
+
197
+ id_GostR3411_94_TestParamSet = id_CryptoPro_hashes + (0,)
198
+
199
+ id_GostR3411_94_CryptoProParamSet = id_CryptoPro_hashes + (1,)
200
+
201
+
202
+
203
+
204
+ class Gost28147_89_ParamSet(univ.ObjectIdentifier):
205
+ pass
206
+
207
+ Gost28147_89_ParamSet.subtypeSpec = constraint.SingleValueConstraint(
208
+ id_Gost28147_89_TestParamSet,
209
+ id_Gost28147_89_CryptoPro_A_ParamSet,
210
+ id_Gost28147_89_CryptoPro_B_ParamSet,
211
+ id_Gost28147_89_CryptoPro_C_ParamSet,
212
+ id_Gost28147_89_CryptoPro_D_ParamSet,
213
+ id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet,
214
+ id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet,
215
+ id_Gost28147_89_CryptoPro_RIC_1_ParamSet,
216
+ rfc7836.id_tc26_gost_28147_param_Z
217
+ )
218
+
219
+
220
+ class Gost28147_89_BlobParameters(univ.Sequence):
221
+ pass
222
+
223
+ Gost28147_89_BlobParameters.componentType = namedtype.NamedTypes(
224
+ namedtype.NamedType('encryptionParamSet', Gost28147_89_ParamSet())
225
+ )
226
+
227
+
228
+ class Gost28147_89_MAC(univ.OctetString):
229
+ pass
230
+
231
+ Gost28147_89_MAC.subtypeSpec = constraint.ValueSizeConstraint(1, 4)
232
+
233
+
234
+ class Gost28147_89_Key(univ.OctetString):
235
+ pass
236
+
237
+ Gost28147_89_Key.subtypeSpec = constraint.ValueSizeConstraint(32, 32)
238
+
239
+
240
+ class Gost28147_89_EncryptedKey(univ.Sequence):
241
+ pass
242
+
243
+ Gost28147_89_EncryptedKey.componentType = namedtype.NamedTypes(
244
+ namedtype.NamedType('encryptedKey', Gost28147_89_Key()),
245
+ namedtype.OptionalNamedType('maskKey', Gost28147_89_Key().subtype(
246
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
247
+ namedtype.NamedType('macKey', Gost28147_89_MAC())
248
+ )
249
+
250
+
251
+ class Gost28147_89_IV(univ.OctetString):
252
+ pass
253
+
254
+ Gost28147_89_IV.subtypeSpec = constraint.ValueSizeConstraint(8, 8)
255
+
256
+
257
+ class Gost28147_89_UZ(univ.OctetString):
258
+ pass
259
+
260
+ Gost28147_89_UZ.subtypeSpec = constraint.ValueSizeConstraint(64, 64)
261
+
262
+
263
+ class Gost28147_89_ParamSetParameters(univ.Sequence):
264
+ pass
265
+
266
+ Gost28147_89_ParamSetParameters.componentType = namedtype.NamedTypes(
267
+ namedtype.NamedType('eUZ', Gost28147_89_UZ()),
268
+ namedtype.NamedType('mode',
269
+ univ.Integer(namedValues=namedval.NamedValues(
270
+ ('gost28147-89-CNT', 0),
271
+ ('gost28147-89-CFB', 1),
272
+ ('cryptoPro-CBC', 2)
273
+ ))),
274
+ namedtype.NamedType('shiftBits',
275
+ univ.Integer(namedValues=namedval.NamedValues(
276
+ ('gost28147-89-block', 64)
277
+ ))),
278
+ namedtype.NamedType('keyMeshing', AlgorithmIdentifier())
279
+ )
280
+
281
+
282
+ class Gost28147_89_Parameters(univ.Sequence):
283
+ pass
284
+
285
+ Gost28147_89_Parameters.componentType = namedtype.NamedTypes(
286
+ namedtype.NamedType('iv', Gost28147_89_IV()),
287
+ namedtype.NamedType('encryptionParamSet', Gost28147_89_ParamSet())
288
+ )
289
+
290
+
291
+ class GostR3410_2001_CertificateSignature(univ.BitString):
292
+ pass
293
+
294
+ GostR3410_2001_CertificateSignature.subtypeSpec=constraint.ValueSizeConstraint(256, 512)
295
+
296
+
297
+ class GostR3410_2001_ParamSetParameters(univ.Sequence):
298
+ pass
299
+
300
+ GostR3410_2001_ParamSetParameters.componentType = namedtype.NamedTypes(
301
+ namedtype.NamedType('a', univ.Integer()),
302
+ namedtype.NamedType('b', univ.Integer()),
303
+ namedtype.NamedType('p', univ.Integer()),
304
+ namedtype.NamedType('q', univ.Integer()),
305
+ namedtype.NamedType('x', univ.Integer()),
306
+ namedtype.NamedType('y', univ.Integer())
307
+ )
308
+
309
+
310
+ class GostR3410_2001_PublicKey(univ.OctetString):
311
+ pass
312
+
313
+ GostR3410_2001_PublicKey.subtypeSpec = constraint.ValueSizeConstraint(64, 64)
314
+
315
+
316
+ class GostR3410_2001_PublicKeyParameters(univ.Sequence):
317
+ pass
318
+
319
+ GostR3410_2001_PublicKeyParameters.componentType = namedtype.NamedTypes(
320
+ namedtype.NamedType('publicKeyParamSet', univ.ObjectIdentifier().subtype(
321
+ subtypeSpec=constraint.SingleValueConstraint(
322
+ id_GostR3410_2001_TestParamSet,
323
+ id_GostR3410_2001_CryptoPro_A_ParamSet,
324
+ id_GostR3410_2001_CryptoPro_B_ParamSet,
325
+ id_GostR3410_2001_CryptoPro_C_ParamSet,
326
+ id_GostR3410_2001_CryptoPro_XchA_ParamSet,
327
+ id_GostR3410_2001_CryptoPro_XchB_ParamSet
328
+ ))),
329
+ namedtype.NamedType('digestParamSet', univ.ObjectIdentifier().subtype(
330
+ subtypeSpec=constraint.SingleValueConstraint(
331
+ id_GostR3411_94_TestParamSet,
332
+ id_GostR3411_94_CryptoProParamSet
333
+ ))),
334
+ namedtype.DefaultedNamedType('encryptionParamSet',
335
+ Gost28147_89_ParamSet().subtype(value=id_Gost28147_89_CryptoPro_A_ParamSet
336
+ ))
337
+ )
338
+
339
+
340
+ class GostR3410_94_CertificateSignature(univ.BitString):
341
+ pass
342
+
343
+ GostR3410_94_CertificateSignature.subtypeSpec = constraint.ValueSizeConstraint(256, 512)
344
+
345
+
346
+ class GostR3410_94_ParamSetParameters_t(univ.Integer):
347
+ pass
348
+
349
+ GostR3410_94_ParamSetParameters_t.subtypeSpec = constraint.SingleValueConstraint(512, 1024)
350
+
351
+
352
+ class GostR3410_94_ParamSetParameters(univ.Sequence):
353
+ pass
354
+
355
+ GostR3410_94_ParamSetParameters.componentType = namedtype.NamedTypes(
356
+ namedtype.NamedType('t', GostR3410_94_ParamSetParameters_t()),
357
+ namedtype.NamedType('p', univ.Integer()),
358
+ namedtype.NamedType('q', univ.Integer()),
359
+ namedtype.NamedType('a', univ.Integer()),
360
+ namedtype.OptionalNamedType('validationAlgorithm', AlgorithmIdentifier())
361
+ )
362
+
363
+
364
+ class GostR3410_94_PublicKey(univ.OctetString):
365
+ pass
366
+
367
+ GostR3410_94_PublicKey.subtypeSpec = constraint.ConstraintsUnion(
368
+ constraint.ValueSizeConstraint(64, 64),
369
+ constraint.ValueSizeConstraint(128, 128)
370
+ )
371
+
372
+
373
+ class GostR3410_94_PublicKeyParameters(univ.Sequence):
374
+ pass
375
+
376
+ GostR3410_94_PublicKeyParameters.componentType = namedtype.NamedTypes(
377
+ namedtype.NamedType('publicKeyParamSet', univ.ObjectIdentifier().subtype(
378
+ subtypeSpec=constraint.SingleValueConstraint(
379
+ id_GostR3410_94_TestParamSet,
380
+ id_GostR3410_94_CryptoPro_A_ParamSet,
381
+ id_GostR3410_94_CryptoPro_B_ParamSet,
382
+ id_GostR3410_94_CryptoPro_C_ParamSet,
383
+ id_GostR3410_94_CryptoPro_D_ParamSet,
384
+ id_GostR3410_94_CryptoPro_XchA_ParamSet,
385
+ id_GostR3410_94_CryptoPro_XchB_ParamSet,
386
+ id_GostR3410_94_CryptoPro_XchC_ParamSet
387
+ ))),
388
+ namedtype.NamedType('digestParamSet', univ.ObjectIdentifier().subtype(
389
+ subtypeSpec=constraint.SingleValueConstraint(
390
+ id_GostR3411_94_TestParamSet,
391
+ id_GostR3411_94_CryptoProParamSet
392
+ ))),
393
+ namedtype.DefaultedNamedType('encryptionParamSet',
394
+ Gost28147_89_ParamSet().subtype(value=id_Gost28147_89_CryptoPro_A_ParamSet
395
+ ))
396
+ )
397
+
398
+
399
+ class GostR3410_94_ValidationBisParameters_c(univ.Integer):
400
+ pass
401
+
402
+ GostR3410_94_ValidationBisParameters_c.subtypeSpec = constraint.ValueRangeConstraint(0, 4294967295)
403
+
404
+
405
+ class GostR3410_94_ValidationBisParameters(univ.Sequence):
406
+ pass
407
+
408
+ GostR3410_94_ValidationBisParameters.componentType = namedtype.NamedTypes(
409
+ namedtype.NamedType('x0', GostR3410_94_ValidationBisParameters_c()),
410
+ namedtype.NamedType('c', GostR3410_94_ValidationBisParameters_c()),
411
+ namedtype.OptionalNamedType('d', univ.Integer())
412
+ )
413
+
414
+
415
+ class GostR3410_94_ValidationParameters_c(univ.Integer):
416
+ pass
417
+
418
+ GostR3410_94_ValidationParameters_c.subtypeSpec = constraint.ValueRangeConstraint(0, 65535)
419
+
420
+
421
+ class GostR3410_94_ValidationParameters(univ.Sequence):
422
+ pass
423
+
424
+ GostR3410_94_ValidationParameters.componentType = namedtype.NamedTypes(
425
+ namedtype.NamedType('x0', GostR3410_94_ValidationParameters_c()),
426
+ namedtype.NamedType('c', GostR3410_94_ValidationParameters_c()),
427
+ namedtype.OptionalNamedType('d', univ.Integer())
428
+ )
429
+
430
+
431
+ class GostR3411_94_Digest(univ.OctetString):
432
+ pass
433
+
434
+ GostR3411_94_Digest.subtypeSpec = constraint.ValueSizeConstraint(32, 32)
435
+
436
+
437
+ class GostR3411_94_DigestParameters(univ.ObjectIdentifier):
438
+ pass
439
+
440
+ GostR3411_94_DigestParameters.subtypeSpec = constraint.ConstraintsUnion(
441
+ constraint.SingleValueConstraint(id_GostR3411_94_TestParamSet),
442
+ constraint.SingleValueConstraint(id_GostR3411_94_CryptoProParamSet),
443
+ )
444
+
445
+
446
+ class GostR3411_94_ParamSetParameters(univ.Sequence):
447
+ pass
448
+
449
+ GostR3411_94_ParamSetParameters.componentType = namedtype.NamedTypes(
450
+ namedtype.NamedType('hUZ', Gost28147_89_UZ()),
451
+ namedtype.NamedType('h0', GostR3411_94_Digest())
452
+ )
453
+
454
+
455
+ # Update the Algorithm Identifier Map and the S/MIME Capability Map
456
+
457
+ _algorithmIdentifierMapUpdate = {
458
+ id_Gost28147_89: Gost28147_89_Parameters(),
459
+ id_Gost28147_89_TestParamSet: Gost28147_89_ParamSetParameters(),
460
+ id_Gost28147_89_CryptoPro_A_ParamSet: Gost28147_89_ParamSetParameters(),
461
+ id_Gost28147_89_CryptoPro_B_ParamSet: Gost28147_89_ParamSetParameters(),
462
+ id_Gost28147_89_CryptoPro_C_ParamSet: Gost28147_89_ParamSetParameters(),
463
+ id_Gost28147_89_CryptoPro_D_ParamSet: Gost28147_89_ParamSetParameters(),
464
+ id_Gost28147_89_CryptoPro_KeyMeshing: univ.Null(""),
465
+ id_Gost28147_89_None_KeyMeshing: univ.Null(""),
466
+ id_GostR3410_94: GostR3410_94_PublicKeyParameters(),
467
+ id_GostR3410_94_TestParamSet: GostR3410_94_ParamSetParameters(),
468
+ id_GostR3410_94_CryptoPro_A_ParamSet: GostR3410_94_ParamSetParameters(),
469
+ id_GostR3410_94_CryptoPro_B_ParamSet: GostR3410_94_ParamSetParameters(),
470
+ id_GostR3410_94_CryptoPro_C_ParamSet: GostR3410_94_ParamSetParameters(),
471
+ id_GostR3410_94_CryptoPro_D_ParamSet: GostR3410_94_ParamSetParameters(),
472
+ id_GostR3410_94_CryptoPro_XchA_ParamSet: GostR3410_94_ParamSetParameters(),
473
+ id_GostR3410_94_CryptoPro_XchB_ParamSet: GostR3410_94_ParamSetParameters(),
474
+ id_GostR3410_94_CryptoPro_XchC_ParamSet: GostR3410_94_ParamSetParameters(),
475
+ id_GostR3410_94_a: GostR3410_94_ValidationParameters(),
476
+ id_GostR3410_94_aBis: GostR3410_94_ValidationBisParameters(),
477
+ id_GostR3410_94_b: GostR3410_94_ValidationParameters(),
478
+ id_GostR3410_94_bBis: GostR3410_94_ValidationBisParameters(),
479
+ id_GostR3410_2001: univ.Null(""),
480
+ id_GostR3411_94: univ.Null(""),
481
+ id_GostR3411_94_TestParamSet: GostR3411_94_ParamSetParameters(),
482
+ id_GostR3411_94_CryptoProParamSet: GostR3411_94_ParamSetParameters(),
483
+ }
484
+
485
+ algorithmIdentifierMap.update(_algorithmIdentifierMapUpdate)
@@ -0,0 +1,23 @@
1
+ #
2
+ # This file is part of pyasn1-alt-modules software.
3
+ #
4
+ # Created by Russ Housley.
5
+ #
6
+ # Copyright (c) 2023-2024, Vigil Security, LLC
7
+ # License: http://vigilsec.com/pyasn1-alt-modules-license.txt
8
+ #
9
+ # PkiPath as used in TLS Extensions
10
+ #
11
+ # ASN.1 source from:
12
+ # https://www.rfc-editor.org/rfc/rfc3546.txt
13
+ #
14
+
15
+ from pyasn1.type import univ
16
+
17
+ from pyasn1_alt_modules import rfc5280
18
+
19
+
20
+ # PkiPath ::= SEQUENCE OF Certificate
21
+
22
+ class PkiPath(univ.SequenceOf):
23
+ componentType = rfc5280.Certificate()
@@ -0,0 +1,23 @@
1
+ #
2
+ # This file is part of pyasn1-alt-modules software.
3
+ #
4
+ # Created by Russ Housley.
5
+ #
6
+ # Copyright (c) 2019-2024, Vigil Security, LLC
7
+ # License: http://vigilsec.com/pyasn1-alt-modules-license.txt
8
+ #
9
+ # Certificate Store Access via HTTP
10
+ #
11
+ # ASN.1 source from:
12
+ # https://www.rfc-editor.org/rfc/rfc4387.txt
13
+ #
14
+
15
+
16
+ from pyasn1.type import univ
17
+
18
+
19
+ id_ad = univ.ObjectIdentifier((1, 3, 6, 1, 5, 5, 7, 48, ))
20
+
21
+ id_ad_http_certs = id_ad + (6, )
22
+
23
+ id_ad_http_crls = id_ad + (7,)
@@ -0,0 +1,99 @@
1
+ #
2
+ # This file is part of pyasn1-alt-modules software.
3
+ #
4
+ # Created by Russ Housley with assistance from asn1ate v.0.6.0.
5
+ # Modified by Russ Housley to include the opentypemap manager.
6
+ #
7
+ # Copyright (c) 2019-2024, Vigil Security, LLC
8
+ # License: http://vigilsec.com/pyasn1-alt-modules-license.txt
9
+ #
10
+ # Attribute Certificate Policies Extension
11
+ #
12
+ # ASN.1 source from:
13
+ # https://www.rfc-editor.org/rfc/rfc4476.txt
14
+ #
15
+
16
+ from pyasn1.type import char
17
+ from pyasn1.type import constraint
18
+ from pyasn1.type import namedtype
19
+ from pyasn1.type import univ
20
+
21
+ from pyasn1_alt_modules import rfc5280
22
+ from pyasn1_alt_modules import opentypemap
23
+
24
+ certificateExtensionsMap = opentypemap.get('certificateExtensionsMap')
25
+
26
+ policyQualifierInfosMap = opentypemap.get('policyQualifierInfosMap')
27
+
28
+ MAX = float('inf')
29
+
30
+
31
+ # Imports from RFC 5280
32
+
33
+ PolicyQualifierId = rfc5280.PolicyQualifierId
34
+
35
+ PolicyQualifierInfo = rfc5280.PolicyQualifierInfo
36
+
37
+ UserNotice = rfc5280.UserNotice
38
+
39
+ id_pkix = rfc5280.id_pkix
40
+
41
+
42
+ # Object Identifiers
43
+
44
+ id_pe = id_pkix + (1,)
45
+
46
+ id_pe_acPolicies = id_pe + (15,)
47
+
48
+ id_qt = id_pkix + (2,)
49
+
50
+ id_qt_acps = id_qt + (4,)
51
+
52
+ id_qt_acunotice = id_qt + (5,)
53
+
54
+
55
+ # Attribute Certificate Policies Extension
56
+
57
+ class ACUserNotice(UserNotice):
58
+ pass
59
+
60
+
61
+ class ACPSuri(char.IA5String):
62
+ pass
63
+
64
+
65
+ class AcPolicyId(univ.ObjectIdentifier):
66
+ pass
67
+
68
+
69
+ class PolicyInformation(univ.Sequence):
70
+ componentType = namedtype.NamedTypes(
71
+ namedtype.NamedType('policyIdentifier', AcPolicyId()),
72
+ namedtype.OptionalNamedType('policyQualifiers',
73
+ univ.SequenceOf(componentType=PolicyQualifierInfo()).subtype(
74
+ subtypeSpec=constraint.ValueSizeConstraint(1, MAX)))
75
+ )
76
+
77
+
78
+ class AcPoliciesSyntax(univ.SequenceOf):
79
+ componentType = PolicyInformation()
80
+ subtypeSpec = constraint.ValueSizeConstraint(1, MAX)
81
+
82
+
83
+ # Update the policy qualifier map
84
+
85
+ _policyQualifierInfosMapUpdate = {
86
+ id_qt_acps: ACPSuri(),
87
+ id_qt_acunotice: UserNotice(),
88
+ }
89
+
90
+ policyQualifierInfosMap.update(_policyQualifierInfosMapUpdate)
91
+
92
+
93
+ # Update the certificate extension map
94
+
95
+ _certificateExtensionsMapUpdate = {
96
+ id_pe_acPolicies: AcPoliciesSyntax(),
97
+ }
98
+
99
+ certificateExtensionsMap.update(_certificateExtensionsMapUpdate)