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,224 @@
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
+ # Certificate Management Protocol (CMP) Algorithms
10
+ #
11
+ # ASN.1 source from:
12
+ # https://www.rfc-editor.org/rfc/rfc9481.txt
13
+ #
14
+ from pyasn1_alt_modules import rfc3370
15
+ from pyasn1_alt_modules import rfc3565
16
+ from pyasn1_alt_modules import rfc4055
17
+ from pyasn1_alt_modules import rfc4210
18
+ from pyasn1_alt_modules import rfc5753
19
+ from pyasn1_alt_modules import rfc5280
20
+ from pyasn1_alt_modules import rfc5480
21
+ from pyasn1_alt_modules import rfc8018
22
+ from pyasn1_alt_modules import rfc8410
23
+ from pyasn1_alt_modules import rfc8692
24
+ from pyasn1_alt_modules import rfc8702
25
+ from pyasn1_alt_modules import rfc9044
26
+
27
+
28
+ # Section 2.1: SHA2
29
+
30
+ id_sha224 = rfc4055.id_sha224
31
+
32
+ id_sha256 = rfc4055.id_sha256
33
+
34
+ id_sha384 = rfc4055.id_sha384
35
+
36
+ id_sha512 = rfc4055.id_sha512
37
+
38
+
39
+ # Section 2.2: SHAKE
40
+
41
+ id_shake128 = rfc8692.id_shake128
42
+
43
+ id_shake256 = rfc8692.id_shake256
44
+
45
+ mda_shake128 = rfc8692.mda_shake128
46
+
47
+ mda_shake256 = rfc8692.mda_shake256
48
+
49
+
50
+ # Section 3.1: RSA
51
+
52
+ id_RSASSA_PSS = rfc4055.id_RSASSA_PSS
53
+
54
+ id_RSASSA_PSS_SHAKE128 = rfc8692.id_RSASSA_PSS_SHAKE128
55
+
56
+ id_RSASSA_PSS_SHAKE256 = rfc8692.id_RSASSA_PSS_SHAKE256
57
+
58
+ sha224WithRSAEncryption = rfc4055.sha224WithRSAEncryption
59
+
60
+ sha256WithRSAEncryption = rfc4055.sha256WithRSAEncryption
61
+
62
+ sha384WithRSAEncryption = rfc4055.sha384WithRSAEncryption
63
+
64
+ sha512WithRSAEncryption = rfc4055.sha512WithRSAEncryption
65
+
66
+ pk_rsaSSA_PSS_SHAKE128 = rfc8692.pk_rsaSSA_PSS_SHAKE128
67
+
68
+ pk_rsaSSA_PSS_SHAKE256 = rfc8692.pk_rsaSSA_PSS_SHAKE256
69
+
70
+ sa_rSASSA_PSS_SHAKE128 = rfc8692.sa_rSASSA_PSS_SHAKE128
71
+
72
+ sa_rSASSA_PSS_SHAKE256 = rfc8692.sa_rSASSA_PSS_SHAKE256
73
+
74
+ sa_rsassapssWithSHAKE128 = rfc8692.sa_rSASSA_PSS_SHAKE128
75
+
76
+ sa_rsassapssWithSHAKE256 = rfc8692.sa_rSASSA_PSS_SHAKE256
77
+
78
+
79
+ # Section 3.2: ECDSA
80
+
81
+ ecdsa_with_SHA224 = rfc5480.ecdsa_with_SHA224
82
+
83
+ ecdsa_with_SHA256 = rfc5480.ecdsa_with_SHA256
84
+
85
+ ecdsa_with_SHA384 = rfc5480.ecdsa_with_SHA384
86
+
87
+ ecdsa_with_SHA512 = rfc5480.ecdsa_with_SHA512
88
+
89
+ secp192r1 = rfc5480.secp192r1
90
+
91
+ secp224r1 = rfc5480.secp224r1
92
+
93
+ secp256r1 = rfc5480.secp256r1
94
+
95
+ secp256r1 = rfc5480.secp256r1
96
+
97
+ secp256r1 = rfc5480.secp256r1
98
+
99
+ id_ecdsa_with_shake128 = rfc8692.id_ecdsa_with_shake128
100
+
101
+ id_ecdsa_with_shake256 = rfc8692.id_ecdsa_with_shake256
102
+
103
+ sa_ecdsa_with_shake128 = rfc8692.sa_ecdsa_with_shake128
104
+
105
+ sa_ecdsa_with_shake256 = rfc8692.sa_ecdsa_with_shake256
106
+
107
+ sa_ecdsaWithSHAKE128 = rfc8692.sa_ecdsa_with_shake128
108
+
109
+ sa_ecdsaWithSHAKE256 = rfc8692.sa_ecdsa_with_shake256
110
+
111
+
112
+ # Section 3.3: EdDSA
113
+
114
+ id_Ed25519 = rfc8410.id_Ed25519
115
+
116
+ id_Ed448 = rfc8410.id_Ed448
117
+
118
+
119
+ # Section 4.1.1: Diffie-Hellman
120
+
121
+ id_alg_ESDH = rfc3370.id_alg_ESDH
122
+
123
+
124
+ # Section 4.1.2: ECDH
125
+
126
+ dhSinglePass_stdDH_sha224kdf_scheme = rfc5753.dhSinglePass_stdDH_sha224kdf_scheme
127
+
128
+ dhSinglePass_stdDH_sha256kdf_scheme = rfc5753.dhSinglePass_stdDH_sha256kdf_scheme
129
+
130
+ dhSinglePass_stdDH_sha384kdf_scheme = rfc5753.dhSinglePass_stdDH_sha384kdf_scheme
131
+
132
+ dhSinglePass_stdDH_sha512kdf_scheme = rfc5753.dhSinglePass_stdDH_sha512kdf_scheme
133
+
134
+ dhSinglePass_cofactorDH_sha224kdf_scheme = rfc5753.dhSinglePass_cofactorDH_sha224kdf_scheme
135
+
136
+ dhSinglePass_cofactorDH_sha256kdf_scheme = rfc5753.dhSinglePass_cofactorDH_sha256kdf_scheme
137
+
138
+ dhSinglePass_cofactorDH_sha256kdf_scheme = rfc5753.dhSinglePass_cofactorDH_sha256kdf_scheme
139
+
140
+ dhSinglePass_cofactorDH_sha256kdf_scheme = rfc5753.dhSinglePass_cofactorDH_sha256kdf_scheme
141
+
142
+ mqvSinglePass_sha224kdf_scheme = rfc5753.mqvSinglePass_sha224kdf_scheme
143
+
144
+ mqvSinglePass_sha256kdf_scheme = rfc5753.mqvSinglePass_sha256kdf_scheme
145
+
146
+ mqvSinglePass_sha384kdf_scheme = rfc5753.mqvSinglePass_sha384kdf_scheme
147
+
148
+ mqvSinglePass_sha512kdf_scheme = rfc5753.mqvSinglePass_sha512kdf_scheme
149
+
150
+ id_X25519 = rfc8410.id_X25519
151
+
152
+ id_X448 = rfc8410.id_X448
153
+
154
+
155
+ # Section 4.2.1: RSA
156
+
157
+ rsaEncryption = rfc4055.rsaEncryption
158
+
159
+ id_RSAES_OAEP = rfc4055.id_RSAES_OAEP
160
+
161
+
162
+ # Section 4.3.1: AES Key Wrap
163
+
164
+ id_aes128_wrap = rfc3565.id_aes128_wrap
165
+
166
+ id_aes192_wrap = rfc3565.id_aes192_wrap
167
+
168
+ id_aes256_wrap = rfc3565.id_aes256_wrap
169
+
170
+
171
+ # Section 4.4.1: PBKDF2
172
+
173
+ id_PBKDF2 = rfc8018.id_PBKDF2
174
+
175
+
176
+ # Section 5.1: AES-CBC
177
+
178
+ id_aes128_CBC = rfc3565.id_aes128_CBC
179
+
180
+ id_aes192_CBC = rfc3565.id_aes192_CBC
181
+
182
+ id_aes256_CBC = rfc3565.id_aes256_CBC
183
+
184
+
185
+ # Section 6.1.1: PasswordBasedMac
186
+
187
+ id_PasswordBasedMac = rfc4210.id_PasswordBasedMac
188
+
189
+
190
+ # Section 6.1.2: PBMAC1
191
+
192
+ id_PBMAC1 = rfc8018.id_PBMAC1
193
+
194
+
195
+ # Section 6.2.1: SHA2-Based HMAC
196
+
197
+ id_hmacWithSHA224 = rfc8018.id_hmacWithSHA224
198
+
199
+ id_hmacWithSHA256 = rfc8018.id_hmacWithSHA256
200
+
201
+ id_hmacWithSHA384 = rfc8018.id_hmacWithSHA384
202
+
203
+ id_hmacWithSHA512 = rfc8018.id_hmacWithSHA512
204
+
205
+
206
+ # Section 6.2.2: AES-GMAC
207
+
208
+ id_aes128_GMAC = rfc9044.id_aes128_GMAC
209
+
210
+ id_aes192_GMAC = rfc9044.id_aes192_GMAC
211
+
212
+ id_aes256_GMAC = rfc9044.id_aes256_GMAC
213
+
214
+
215
+ # Section 6.2.3: SHAKE-Based KMAC
216
+
217
+ id_KMACWithSHAKE128 = rfc8702.id_KMACWithSHAKE128
218
+
219
+ id_KMACWithSHAKE256 = rfc8702.id_KMACWithSHAKE256
220
+
221
+
222
+ # Note that there is no need to update the Algorithm Identifiers Map.
223
+ # The Algorithm Identifiers Map has already been updated by importing
224
+ # the module that originally defined the object identifier.
@@ -0,0 +1,24 @@
1
+ #
2
+ # This file is part of pyasn1-alt-modules software.
3
+ #
4
+ # Created by Russ Housley.
5
+ #
6
+ # Copyright (c) 2024, Vigil Security, LLC
7
+ # License: http://vigilsec.com/pyasn1-alt-modules-license.txt
8
+ #
9
+ # Extended Key Usage (EKU) for 5G Network Functions
10
+ #
11
+ # ASN.1 source from:
12
+ # https://www.rfc-editor.org/rfc/rfc9509.txt
13
+ #
14
+
15
+ from pyasn1.type import univ
16
+
17
+
18
+ id_kp = univ.ObjectIdentifier('1.3.6.1.5.5.7.3')
19
+
20
+ id_kp_jwt = id_kp + (37,)
21
+
22
+ id_kp_httpContentEncrypt = id_kp + (38,)
23
+
24
+ id_kp_oauthAccessTokenSigning = id_kp + (39,)
@@ -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) 2024, Vigil Security, LLC
7
+ # License: http://vigilsec.com/pyasn1-alt-modules-license.txt
8
+ #
9
+ # Generating Transport Key Containers Using the GOST Algorithms
10
+ #
11
+ # ASN.1 source from:
12
+ # https://www.rfc-editor.org/rfc/rfc9548.txt
13
+ #
14
+
15
+ from pyasn1_alt_modules import rfc9215
16
+
17
+
18
+ # Import from RFC 9215
19
+
20
+ GostR3410_2012_PublicKey = rfc9215.GostR3410_2012_PublicKey
21
+
22
+
23
+ # The Algorithm Identifier Map update was done by importing rfc9215.
@@ -0,0 +1,89 @@
1
+ #
2
+ # This file is part of pyasn1-alt-modules software.
3
+ #
4
+ # Created by Russ Housley.
5
+ #
6
+ # Copyright (c) 2024, Vigil Security, LLC
7
+ # License: http://vigilsec.com/pyasn1-alt-modules-license.txt
8
+ #
9
+ # Use of PBMAC1 in the PKCS #12 Syntax
10
+ #
11
+ # ASN.1 source from:
12
+ # https://www.rfc-editor.org/rfc/rfc9579.txt
13
+ #
14
+
15
+ from pyasn1.type import univ
16
+
17
+ from pyasn1_alt_modules import rfc5280
18
+ from pyasn1_alt_modules import rfc8018
19
+
20
+
21
+ # Import from RFC 5280
22
+
23
+ AlgorithmIdentifier = rfc5280.AlgorithmIdentifier
24
+
25
+
26
+ # Import from RFC 8018
27
+
28
+ rsadsi = rfc8018.rsadsi
29
+
30
+ pkcs = rfc8018.pkcs
31
+
32
+ pkcs_5 = rfc8018.pkcs_5
33
+
34
+ id_hmacWithSHA1 = rfc8018.id_hmacWithSHA1
35
+
36
+ id_hmacWithSHA224 = rfc8018.id_hmacWithSHA224
37
+
38
+ id_hmacWithSHA256 = rfc8018.id_hmacWithSHA256
39
+
40
+ id_hmacWithSHA384 = rfc8018.id_hmacWithSHA384
41
+
42
+ id_hmacWithSHA512 = rfc8018.id_hmacWithSHA512
43
+
44
+ id_hmacWithSHA512_224 = rfc8018.id_hmacWithSHA512_224
45
+
46
+ id_hmacWithSHA512_256 = rfc8018.id_hmacWithSHA512_256
47
+
48
+ id_PBMAC1 = rfc8018.id_PBMAC1
49
+
50
+ PBMAC1_params = rfc8018.PBMAC1_params
51
+
52
+ id_PBKDF2 = rfc8018.id_PBKDF2
53
+
54
+ PBKDF2_params = rfc8018.PBKDF2_params
55
+
56
+
57
+ # HMAC algorithm identifiers
58
+
59
+ algid_hmacWithSHA1 = AlgorithmIdentifier()
60
+ algid_hmacWithSHA1['algorithm'] = id_hmacWithSHA1
61
+ algid_hmacWithSHA1['parameters'] = univ.Null("")
62
+
63
+ algid_hmacWithSHA224 = AlgorithmIdentifier()
64
+ algid_hmacWithSHA224['algorithm'] = id_hmacWithSHA224
65
+ algid_hmacWithSHA224['parameters'] = univ.Null("")
66
+
67
+ algid_hmacWithSHA256 = AlgorithmIdentifier()
68
+ algid_hmacWithSHA256['algorithm'] = id_hmacWithSHA256
69
+ algid_hmacWithSHA256['parameters'] = univ.Null("")
70
+
71
+ algid_hmacWithSHA384 = AlgorithmIdentifier()
72
+ algid_hmacWithSHA384['algorithm'] = id_hmacWithSHA384
73
+ algid_hmacWithSHA384['parameters'] = univ.Null("")
74
+
75
+ algid_hmacWithSHA512 = AlgorithmIdentifier()
76
+ algid_hmacWithSHA512['algorithm'] = id_hmacWithSHA512
77
+ algid_hmacWithSHA512['parameters'] = univ.Null("")
78
+
79
+ algid_hmacWithSHA512_224 = AlgorithmIdentifier()
80
+ algid_hmacWithSHA512_224['algorithm'] = id_hmacWithSHA512_224
81
+ algid_hmacWithSHA512_224['parameters'] = univ.Null("")
82
+
83
+ algid_hmacWithSHA512_256 = AlgorithmIdentifier()
84
+ algid_hmacWithSHA512_256['algorithm'] = id_hmacWithSHA512_256
85
+ algid_hmacWithSHA512_256['parameters'] = univ.Null("")
86
+
87
+
88
+ # No need to Update the Algorithm Identifier map or the S/MIME Capabilities map;
89
+ # these updates were handled by importing RFC 8018.
@@ -0,0 +1,107 @@
1
+ #
2
+ # This file is part of pyasn1-alt-modules software.
3
+ #
4
+ # Created by Russ Housley with assistance from asn1ate v.0.6.0.
5
+ #
6
+ # Copyright (c) 2024, Vigil Security, LLC
7
+ # License: http://vigilsec.com/pyasn1-alt-modules-license.txt
8
+ #
9
+ # RPKI Route Origin Authorizations (ROAs)
10
+ #
11
+ # ASN.1 source from:
12
+ # https://www.rfc-editor.org/rfc/rfc9582.txt
13
+ #
14
+
15
+ from pyasn1.type import constraint
16
+ from pyasn1.type import namedtype
17
+ from pyasn1.type import tag
18
+ from pyasn1.type import univ
19
+
20
+ from pyasn1_alt_modules import rfc5652
21
+ from pyasn1_alt_modules import opentypemap
22
+
23
+ cmsContentTypesMap = opentypemap.get('cmsContentTypesMap')
24
+
25
+ MAX = float('inf')
26
+
27
+
28
+ id_ct_routeOriginAuthz = univ.ObjectIdentifier('1.2.840.113549.1.9.16.1.24')
29
+
30
+ afi_IPv4 = univ.OctetString(hexValue='0001').subtype(
31
+ subtypeSpec=constraint.ValueSizeConstraint(2, 2))
32
+
33
+ afi_IPv6 = univ.OctetString(hexValue='0002').subtype(
34
+ subtypeSpec=constraint.ValueSizeConstraint(2, 2))
35
+
36
+ ub_IPv4 = univ.Integer(32)
37
+
38
+ ub_IPv6 = univ.Integer(128)
39
+
40
+
41
+ class ASID(univ.Integer):
42
+ subtypeSpec = constraint.ValueRangeConstraint(0, 4294967295)
43
+
44
+
45
+ class ROAIPAddress(univ.Sequence):
46
+ componentType = namedtype.NamedTypes(
47
+ namedtype.NamedType('address', univ.BitString()),
48
+ # For IPv4, the maximum size of the BitString is ub_IPv4 bits
49
+ # For IPv6, the maximum size of the BitString is ub_IPv6 bits
50
+ namedtype.OptionalNamedType('maxLength', univ.Integer())
51
+ # For IPv4, the maximum value of the Integer is ub_IPv4
52
+ # For IPv6, the maximum value of the Integer is ub_IPv6
53
+ )
54
+
55
+
56
+ class ROAAddresses(univ.SequenceOf):
57
+ componentType = ROAIPAddress()
58
+ subtypeSpec = constraint.ValueSizeConstraint(1, MAX)
59
+
60
+
61
+ ROAIPAddressIPv4 = ROAIPAddress
62
+
63
+ ROAIPAddressIPv6 = ROAIPAddress
64
+
65
+ ROAAddressesIPv4 = ROAAddresses
66
+
67
+ ROAAddressesIPv6 = ROAAddresses
68
+
69
+
70
+ class ROAIPAddressFamily(univ.Sequence):
71
+ componentType = namedtype.NamedTypes(
72
+ namedtype.NamedType('addressFamily',
73
+ univ.OctetString().subtype(
74
+ subtypeSpec=constraint.ValueSizeConstraint(2, 2))),
75
+ namedtype.NamedType('addresses', ROAAddresses())
76
+ )
77
+
78
+
79
+ class RouteOriginAttestation(univ.Sequence):
80
+ componentType = namedtype.NamedTypes(
81
+ namedtype.DefaultedNamedType('version',
82
+ univ.Integer().subtype(explicitTag=tag.Tag(
83
+ tag.tagClassContext, tag.tagFormatSimple, 0)).subtype(value=0)),
84
+ namedtype.NamedType('asID', ASID()),
85
+ namedtype.NamedType('ipAddrBlocks',
86
+ univ.SequenceOf(componentType=ROAIPAddressFamily()).subtype(
87
+ subtypeSpec=constraint.ValueSizeConstraint(1, 2)))
88
+ )
89
+
90
+
91
+ addressFamilyIPv4 = ROAIPAddressFamily()
92
+ addressFamilyIPv4['addressFamily'] = afi_IPv4
93
+ addressFamilyIPv4['addresses'] = ROAAddressesIPv4()
94
+
95
+
96
+ addressFamilyIPv6 = ROAIPAddressFamily()
97
+ addressFamilyIPv6['addressFamily'] = afi_IPv6
98
+ addressFamilyIPv6['addresses'] = ROAAddressesIPv6()
99
+
100
+
101
+ # Update the CMS Content Types Map
102
+
103
+ _cmsContentTypesMapUpdate = {
104
+ id_ct_routeOriginAuthz: RouteOriginAttestation(),
105
+ }
106
+
107
+ cmsContentTypesMap.update(_cmsContentTypesMapUpdate)
@@ -0,0 +1,52 @@
1
+ #
2
+ # This file is part of pyasn1-alt-modules software.
3
+ #
4
+ # Created by Russ Housley.
5
+ #
6
+ # Copyright (c) 2024, Vigil Security, LLC
7
+ # License: http://vigilsec.com/pyasn1-alt-modules-license.txt
8
+ #
9
+ # Internationalized Email Addresses in X.509 Certificates
10
+ #
11
+ # ASN.1 source from:
12
+ # https://www.rfc-editor.org/rfc/rfc9598.txt
13
+ #
14
+
15
+ from pyasn1.type import char
16
+ from pyasn1.type import constraint
17
+ from pyasn1.type import univ
18
+
19
+ from pyasn1_alt_modules import rfc5280
20
+ from pyasn1_alt_modules import opentypemap
21
+
22
+ otherNamesMap = opentypemap.get('otherNamesMap')
23
+
24
+ MAX = float('inf')
25
+
26
+
27
+ # SmtpUTF8Mailbox contains Mailbox as specified in Section 3.3 of RFC 6531.
28
+ # RFC 9598 requires that the domain name be represented as A-labels.
29
+
30
+ id_pkix = rfc5280.id_pkix
31
+
32
+ id_on = id_pkix + (8, )
33
+
34
+ id_on_SmtpUTF8Mailbox = id_on + (9, )
35
+
36
+
37
+ class SmtpUTF8Mailbox(char.UTF8String):
38
+ subtypeSpec = constraint.ValueSizeConstraint(1, MAX)
39
+
40
+
41
+ on_SmtpUTF8Mailbox = rfc5280.AnotherName()
42
+ on_SmtpUTF8Mailbox['type-id'] = id_on_SmtpUTF8Mailbox
43
+ on_SmtpUTF8Mailbox['value'] = SmtpUTF8Mailbox()
44
+
45
+
46
+ # Update the Other Names Map
47
+
48
+ _otherNamesMapUpdate = {
49
+ id_on_SmtpUTF8Mailbox: SmtpUTF8Mailbox(),
50
+ }
51
+
52
+ otherNamesMap.update(_otherNamesMapUpdate)
@@ -0,0 +1,35 @@
1
+ #
2
+ # This file is part of pyasn1-alt-modules software.
3
+ #
4
+ # Created by Russ Housley.
5
+ #
6
+ # Copyright (c) 2024, Vigil Security, LLC
7
+ # License: http://vigilsec.com/pyasn1-alt-modules-license.txt
8
+ #
9
+ # The noRevAvail Certificate Extension
10
+ #
11
+ # ASN.1 source from:
12
+ # https://www.rfc-editor.org/rfc/rfc9608.txt
13
+ #
14
+
15
+ from pyasn1.type import univ
16
+ from pyasn1_alt_modules import opentypemap
17
+
18
+
19
+ certificateExtensionsMap = opentypemap.get('certificateExtensionsMap')
20
+
21
+
22
+ # Object Identifiers
23
+
24
+ id_ce = univ.ObjectIdentifier((2, 5, 29, ))
25
+
26
+ id_ce_noRevAvail = id_ce + (56, )
27
+
28
+
29
+ # Update the Certificate Extensions Map
30
+
31
+ _certificateExtensionsMapUpdate = {
32
+ id_ce_noRevAvail: univ.Null(),
33
+ }
34
+
35
+ certificateExtensionsMap.update(_certificateExtensionsMapUpdate)
@@ -0,0 +1,100 @@
1
+ #
2
+ # This file is part of pyasn1-alt-modules software.
3
+ #
4
+ # Created by Russ Housley with some help from by asn1ate v.0.6.0.
5
+ #
6
+ # Copyright (c) 2023-2024, Vigil Security, LLC
7
+ # License: http://vigilsec.com/pyasn1-alt-modules-license.txt
8
+ #
9
+ # CMS KEMRecipientInfo
10
+ #
11
+ # ASN.1 source from:
12
+ # https://www.rfc-editor.org/rfc/rfc9629.txt
13
+ #
14
+
15
+ from pyasn1.type import constraint
16
+ from pyasn1.type import namedtype
17
+ from pyasn1.type import tag
18
+ from pyasn1.type import univ
19
+
20
+ from pyasn1_alt_modules import rfc5280
21
+ from pyasn1_alt_modules import rfc5652
22
+ from pyasn1_alt_modules import opentypemap
23
+
24
+ otherRecipientInfoMap = opentypemap.get('otherRecipientInfoMap')
25
+
26
+ MAX = float('inf')
27
+
28
+
29
+ # Imports from RFC 5280
30
+
31
+ AlgorithmIdentifier = rfc5280.AlgorithmIdentifier
32
+
33
+
34
+ # Imports from RFC 5652
35
+
36
+ CMSVersion = rfc5652.CMSVersion
37
+
38
+ EncryptedKey = rfc5652.EncryptedKey
39
+
40
+ KeyDerivationAlgorithmIdentifier = rfc5652.KeyDerivationAlgorithmIdentifier
41
+
42
+ KeyEncryptionAlgorithmIdentifier = rfc5652.KeyEncryptionAlgorithmIdentifier
43
+
44
+ RecipientIdentifier = rfc5652.RecipientIdentifier
45
+
46
+ UserKeyingMaterial = rfc5652.UserKeyingMaterial
47
+
48
+
49
+ # Object Identifiers
50
+
51
+ id_ori = univ.ObjectIdentifier((1, 2, 840, 113549, 1, 9, 16, 13))
52
+
53
+ id_ori_kem = id_ori + (3,)
54
+
55
+
56
+ # KEMRecipientInfo
57
+
58
+ class KEMAlgorithmIdentifier(AlgorithmIdentifier):
59
+ pass
60
+
61
+
62
+ class KEMRecipientInfo(univ.Sequence):
63
+ componentType = namedtype.NamedTypes(
64
+ namedtype.NamedType('version', CMSVersion()),
65
+ namedtype.NamedType('rid', RecipientIdentifier()),
66
+ namedtype.NamedType('kem', KEMAlgorithmIdentifier()),
67
+ namedtype.NamedType('kemct', univ.OctetString()),
68
+ namedtype.NamedType('kdf', KeyDerivationAlgorithmIdentifier()),
69
+ namedtype.NamedType('kekLength',
70
+ univ.Integer().subtype(
71
+ subtypeSpec=constraint.ValueRangeConstraint(1, MAX))),
72
+ namedtype.OptionalNamedType('ukm',
73
+ UserKeyingMaterial().subtype(explicitTag=tag.Tag(
74
+ tag.tagClassContext, tag.tagFormatSimple, 0))),
75
+ namedtype.NamedType('wrap', KeyEncryptionAlgorithmIdentifier()),
76
+ namedtype.NamedType('encryptedKey', EncryptedKey())
77
+ )
78
+
79
+
80
+ # CMSORIforKEMOtherInfo
81
+
82
+ class CMSORIforKEMOtherInfo(univ.Sequence):
83
+ componentType = namedtype.NamedTypes(
84
+ namedtype.NamedType('wrap', KeyEncryptionAlgorithmIdentifier()),
85
+ namedtype.NamedType('kekLength',
86
+ univ.Integer().subtype(
87
+ subtypeSpec=constraint.ValueRangeConstraint(1, MAX))),
88
+ namedtype.OptionalNamedType('ukm',
89
+ UserKeyingMaterial().subtype(explicitTag=tag.Tag(
90
+ tag.tagClassContext, tag.tagFormatSimple, 0)))
91
+ )
92
+
93
+
94
+ # Update the CMS Other Recipient Info Map
95
+
96
+ _otherRecipientInfoMapUpdate = {
97
+ id_ori_kem: KEMRecipientInfo(),
98
+ }
99
+
100
+ otherRecipientInfoMap.update(_otherRecipientInfoMapUpdate)