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,190 @@
1
+ # This file is part of pyasn1-alt-modules software.
2
+ #
3
+ # Created by Russ Housley with assistance from asn1ate v.0.6.0.
4
+ # Modified by Russ Housley to add maps for opentypes.
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
+ # Elliptic Curve Cryptography Subject Public Key Information
11
+ #
12
+ # ASN.1 source from:
13
+ # https://www.rfc-editor.org/rfc/rfc5480.txt
14
+
15
+
16
+ # What can be imported from rfc4055.py ?
17
+
18
+ from pyasn1.type import namedtype
19
+ from pyasn1.type import univ
20
+
21
+ from pyasn1_alt_modules import rfc3279
22
+ from pyasn1_alt_modules import opentypemap
23
+
24
+ algorithmIdentifierMap = opentypemap.get('algorithmIdentifierMap')
25
+
26
+
27
+ # These structures are the same as RFC 3279.
28
+
29
+ DHPublicKey = rfc3279.DHPublicKey
30
+
31
+ DSAPublicKey = rfc3279.DSAPublicKey
32
+
33
+ ValidationParms = rfc3279.ValidationParms
34
+
35
+ DomainParameters = rfc3279.DomainParameters
36
+
37
+ ECDSA_Sig_Value = rfc3279.ECDSA_Sig_Value
38
+
39
+ ECPoint = rfc3279.ECPoint
40
+
41
+ KEA_Parms_Id = rfc3279.KEA_Parms_Id
42
+
43
+ RSAPublicKey = rfc3279.RSAPublicKey
44
+
45
+
46
+ # RFC 5480 changed the names of these structures from RFC 3279.
47
+
48
+ DSS_Parms = rfc3279.Dss_Parms
49
+
50
+ DSA_Sig_Value = rfc3279.Dss_Sig_Value
51
+
52
+
53
+ # RFC 3279 defines a more complex alternative for ECParameters.
54
+ # RFC 5480 narrows the definition to a single CHOICE: namedCurve.
55
+
56
+ class ECParameters(univ.Choice):
57
+ pass
58
+
59
+ ECParameters.componentType = namedtype.NamedTypes(
60
+ namedtype.NamedType('namedCurve', univ.ObjectIdentifier())
61
+ )
62
+
63
+
64
+ # OIDs for Message Digest Algorithms
65
+
66
+ id_md2 = univ.ObjectIdentifier('1.2.840.113549.2.2')
67
+
68
+ id_md5 = univ.ObjectIdentifier('1.2.840.113549.2.5')
69
+
70
+ id_sha1 = univ.ObjectIdentifier('1.3.14.3.2.26')
71
+
72
+ id_sha224 = univ.ObjectIdentifier('2.16.840.1.101.3.4.2.4')
73
+
74
+ id_sha256 = univ.ObjectIdentifier('2.16.840.1.101.3.4.2.1')
75
+
76
+ id_sha384 = univ.ObjectIdentifier('2.16.840.1.101.3.4.2.2')
77
+
78
+ id_sha512 = univ.ObjectIdentifier('2.16.840.1.101.3.4.2.3')
79
+
80
+
81
+ # OID for RSA PK Algorithm and Key
82
+
83
+ rsaEncryption = univ.ObjectIdentifier('1.2.840.113549.1.1.1')
84
+
85
+
86
+ # OID for DSA PK Algorithm, Key, and Parameters
87
+
88
+ id_dsa = univ.ObjectIdentifier('1.2.840.10040.4.1')
89
+
90
+
91
+ # OID for Diffie-Hellman PK Algorithm, Key, and Parameters
92
+
93
+ dhpublicnumber = univ.ObjectIdentifier('1.2.840.10046.2.1')
94
+
95
+ # OID for KEA PK Algorithm and Parameters
96
+
97
+ id_keyExchangeAlgorithm = univ.ObjectIdentifier('2.16.840.1.101.2.1.1.22')
98
+
99
+
100
+ # OIDs for Elliptic Curve Algorithm ID, Key, and Parameters
101
+ # Note that ECDSA keys always use this OID
102
+
103
+ id_ecPublicKey = univ.ObjectIdentifier('1.2.840.10045.2.1')
104
+
105
+ id_ecDH = univ.ObjectIdentifier('1.3.132.1.12')
106
+
107
+ id_ecMQV = univ.ObjectIdentifier('1.3.132.1.13')
108
+
109
+
110
+ # OIDs for RSA Signature Algorithms
111
+
112
+ md2WithRSAEncryption = univ.ObjectIdentifier('1.2.840.113549.1.1.2')
113
+
114
+ md5WithRSAEncryption = univ.ObjectIdentifier('1.2.840.113549.1.1.4')
115
+
116
+ sha1WithRSAEncryption = univ.ObjectIdentifier('1.2.840.113549.1.1.5')
117
+
118
+
119
+ # OIDs for DSA Signature Algorithms
120
+
121
+ id_dsa_with_sha1 = univ.ObjectIdentifier('1.2.840.10040.4.3')
122
+
123
+ id_dsa_with_sha224 = univ.ObjectIdentifier('2.16.840.1.101.3.4.3.1')
124
+
125
+ id_dsa_with_sha256 = univ.ObjectIdentifier('2.16.840.1.101.3.4.3.2')
126
+
127
+
128
+ # OIDs for ECDSA Signature Algorithms
129
+
130
+ ecdsa_with_SHA1 = univ.ObjectIdentifier('1.2.840.10045.4.1')
131
+
132
+ ecdsa_with_SHA224 = univ.ObjectIdentifier('1.2.840.10045.4.3.1')
133
+
134
+ ecdsa_with_SHA256 = univ.ObjectIdentifier('1.2.840.10045.4.3.2')
135
+
136
+ ecdsa_with_SHA384 = univ.ObjectIdentifier('1.2.840.10045.4.3.3')
137
+
138
+ ecdsa_with_SHA512 = univ.ObjectIdentifier('1.2.840.10045.4.3.4')
139
+
140
+
141
+ # OIDs for Named Elliptic Curves
142
+
143
+ secp192r1 = univ.ObjectIdentifier('1.2.840.10045.3.1.1')
144
+
145
+ sect163k1 = univ.ObjectIdentifier('1.3.132.0.1')
146
+
147
+ sect163r2 = univ.ObjectIdentifier('1.3.132.0.15')
148
+
149
+ secp224r1 = univ.ObjectIdentifier('1.3.132.0.33')
150
+
151
+ sect233k1 = univ.ObjectIdentifier('1.3.132.0.26')
152
+
153
+ sect233r1 = univ.ObjectIdentifier('1.3.132.0.27')
154
+
155
+ secp256r1 = univ.ObjectIdentifier('1.2.840.10045.3.1.7')
156
+
157
+ sect283k1 = univ.ObjectIdentifier('1.3.132.0.16')
158
+
159
+ sect283r1 = univ.ObjectIdentifier('1.3.132.0.17')
160
+
161
+ secp384r1 = univ.ObjectIdentifier('1.3.132.0.34')
162
+
163
+ sect409k1 = univ.ObjectIdentifier('1.3.132.0.36')
164
+
165
+ sect409r1 = univ.ObjectIdentifier('1.3.132.0.37')
166
+
167
+ secp521r1 = univ.ObjectIdentifier('1.3.132.0.35')
168
+
169
+ sect571k1 = univ.ObjectIdentifier('1.3.132.0.38')
170
+
171
+ sect571r1 = univ.ObjectIdentifier('1.3.132.0.39')
172
+
173
+
174
+ # Update the Algorithm Identifiers Map; however, the algorithm is not
175
+ # included if the parameters MUST be absent
176
+
177
+ _algorithmIdentifierMapUpdate = {
178
+ rsaEncryption: univ.Null(),
179
+ md2WithRSAEncryption: univ.Null(),
180
+ md5WithRSAEncryption: univ.Null(),
181
+ sha1WithRSAEncryption: univ.Null(),
182
+ id_dsa: DSS_Parms(),
183
+ dhpublicnumber: DomainParameters(),
184
+ id_keyExchangeAlgorithm: KEA_Parms_Id(),
185
+ id_ecPublicKey: ECParameters(),
186
+ id_ecDH: ECParameters(),
187
+ id_ecMQV: ECParameters(),
188
+ }
189
+
190
+ algorithmIdentifierMap.update(_algorithmIdentifierMapUpdate)
@@ -0,0 +1,127 @@
1
+ #
2
+ # This file is part of pyasn1-alt-modules software.
3
+ #
4
+ # Created by Russ Housley with assistance from asn1ate v.0.6.0.
5
+ # Modified by Russ Housley to include the opentypemap manager.
6
+ #
7
+ # Copyright (c) 2021-2024, Vigil Security, LLC
8
+ # License: http://vigilsec.com/pyasn1-alt-modules-license.txt
9
+ #
10
+ # TimeStampedData
11
+ #
12
+ # ASN.1 source from:
13
+ # https://www.rfc-editor.org/rfc/rfc5544.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 namedval
20
+ from pyasn1.type import opentype
21
+ from pyasn1.type import tag
22
+ from pyasn1.type import univ
23
+
24
+ from pyasn1_alt_modules import rfc3161
25
+ from pyasn1_alt_modules import rfc4998
26
+ from pyasn1_alt_modules import rfc5280
27
+ from pyasn1_alt_modules import rfc5652
28
+ from pyasn1_alt_modules import opentypemap
29
+
30
+ otherEvidenceMap = opentypemap.get('otherEvidenceMap')
31
+
32
+ cmsContentTypesMap = opentypemap.get('cmsContentTypesMap')
33
+
34
+ MAX = float('inf')
35
+
36
+
37
+ # Imports from RFC 5652
38
+
39
+ Attribute = rfc5652.Attribute
40
+
41
+
42
+ # Imports from RFC 5280
43
+
44
+ CertificateList = rfc5280.CertificateList
45
+
46
+
47
+ # Imports from RFC 3161
48
+
49
+ TimeStampToken = rfc3161.TimeStampToken
50
+
51
+
52
+ # Imports from RFC 4998
53
+
54
+ EvidenceRecord = rfc4998.EvidenceRecord
55
+
56
+
57
+ # TimeStampedData
58
+
59
+ class Attributes(univ.SetOf):
60
+ componentType = Attribute()
61
+ subtypeSpec = constraint.ValueSizeConstraint(1, MAX)
62
+
63
+
64
+ class TimeStampAndCRL(univ.Sequence):
65
+ componentType = namedtype.NamedTypes(
66
+ namedtype.NamedType('timeStamp', TimeStampToken()),
67
+ namedtype.OptionalNamedType('crl', CertificateList())
68
+ )
69
+
70
+
71
+ class TimeStampTokenEvidence(univ.SequenceOf):
72
+ componentType = TimeStampAndCRL()
73
+ subtypeSpec = constraint.ValueSizeConstraint(1, MAX)
74
+
75
+
76
+ class OtherEvidence(univ.Sequence):
77
+ componentType = namedtype.NamedTypes(
78
+ namedtype.NamedType('oeType', univ.ObjectIdentifier()),
79
+ namedtype.NamedType('oeValue', univ.Any(),
80
+ openType=opentype.OpenType('oeType', otherEvidenceMap))
81
+ )
82
+
83
+
84
+ class Evidence(univ.Choice):
85
+ componentType = namedtype.NamedTypes(
86
+ namedtype.NamedType('tstEvidence',
87
+ TimeStampTokenEvidence().subtype(implicitTag=tag.Tag(
88
+ tag.tagClassContext, tag.tagFormatSimple, 0))),
89
+ namedtype.NamedType('ersEvidence',
90
+ EvidenceRecord().subtype(implicitTag=tag.Tag(
91
+ tag.tagClassContext, tag.tagFormatSimple, 1))),
92
+ namedtype.NamedType('otherEvidence',
93
+ OtherEvidence().subtype(implicitTag=tag.Tag(
94
+ tag.tagClassContext, tag.tagFormatConstructed, 2)))
95
+ )
96
+
97
+
98
+ class MetaData(univ.Sequence):
99
+ componentType = namedtype.NamedTypes(
100
+ namedtype.NamedType('hashProtected', univ.Boolean()),
101
+ namedtype.OptionalNamedType('fileName', char.UTF8String()),
102
+ namedtype.OptionalNamedType('mediaType', char.IA5String()),
103
+ namedtype.OptionalNamedType('otherMetaData', Attributes())
104
+ )
105
+
106
+
107
+ class TimeStampedData(univ.Sequence):
108
+ componentType = namedtype.NamedTypes(
109
+ namedtype.NamedType('version',
110
+ univ.Integer(namedValues=namedval.NamedValues(('v1', 1)))),
111
+ namedtype.OptionalNamedType('dataUri', char.IA5String()),
112
+ namedtype.OptionalNamedType('metaData', MetaData()),
113
+ namedtype.OptionalNamedType('content', univ.OctetString()),
114
+ namedtype.NamedType('temporalEvidence', Evidence())
115
+ )
116
+
117
+
118
+ id_ct_timestampedData = univ.ObjectIdentifier('1.2.840.113549.1.9.16.1.31')
119
+
120
+
121
+ # Update the CMS Content Types Map
122
+
123
+ _cmsContentTypesMapUpdate = {
124
+ id_ct_timestampedData: TimeStampedData(),
125
+ }
126
+
127
+ cmsContentTypesMap.update(_cmsContentTypesMapUpdate)
@@ -0,0 +1,117 @@
1
+ # This file is part of pyasn1-alt-modules software.
2
+ #
3
+ # Created by Russ Housley.
4
+ # Modified by Russ Housley to include the opentypemap manager.
5
+ #
6
+ # Copyright (c) 2019-2024, Vigil Security, LLC
7
+ # License: http://vigilsec.com/pyasn1-alt-modules-license.txt
8
+ #
9
+ # Traceable Anonymous Certificate
10
+ #
11
+ # ASN.1 source from:
12
+ # https://www.rfc-editor.org/rfc/rfc5480.txt
13
+
14
+ from pyasn1.type import namedtype
15
+ from pyasn1.type import univ
16
+ from pyasn1.type import useful
17
+
18
+ from pyasn1_alt_modules import rfc5652
19
+ from pyasn1_alt_modules import opentypemap
20
+
21
+ cmsContentTypesMap = opentypemap.get('cmsContentTypesMap')
22
+
23
+
24
+ # Imports from RFC 5652
25
+
26
+ ContentInfo = rfc5652.ContentInfo
27
+
28
+ EncapsulatedContentInfo = rfc5652.EncapsulatedContentInfo
29
+
30
+ id_data = rfc5652.id_data
31
+
32
+
33
+ # Object Identifiers
34
+
35
+ id_KISA = univ.ObjectIdentifier((1, 2, 410, 200004,))
36
+
37
+
38
+ id_npki = id_KISA + (10,)
39
+
40
+
41
+ id_attribute = id_npki + (1,)
42
+
43
+
44
+ id_kisa_tac = id_attribute + (1,)
45
+
46
+
47
+ id_kisa_tac_token = id_kisa_tac + (1,)
48
+
49
+
50
+ id_kisa_tac_tokenandblindbash = id_kisa_tac + (2,)
51
+
52
+
53
+ id_kisa_tac_tokenandpartially = id_kisa_tac + (3,)
54
+
55
+
56
+ # Structures for Traceable Anonymous Certificate (TAC)
57
+
58
+ class UserKey(univ.OctetString):
59
+ pass
60
+
61
+
62
+ class Timeout(useful.GeneralizedTime):
63
+ pass
64
+
65
+
66
+ class BlinedCertificateHash(univ.OctetString):
67
+ pass
68
+
69
+
70
+ class PartiallySignedCertificateHash(univ.OctetString):
71
+ pass
72
+
73
+
74
+ class Token(ContentInfo):
75
+ pass
76
+
77
+
78
+ class TokenandBlindHash(ContentInfo):
79
+ pass
80
+
81
+
82
+ class TokenandPartiallySignedCertificateHash(ContentInfo):
83
+ pass
84
+
85
+
86
+ # Added to the module in RFC 5636 for the CMS Content Type Map
87
+
88
+ class TACToken(univ.Sequence):
89
+ componentType = namedtype.NamedTypes(
90
+ namedtype.NamedType('userKey', UserKey()),
91
+ namedtype.NamedType('timeout', Timeout())
92
+ )
93
+
94
+
95
+ class TACTokenandBlindHash(univ.Sequence):
96
+ componentType = namedtype.NamedTypes(
97
+ namedtype.NamedType('token', Token()),
98
+ namedtype.NamedType('blinded', BlinedCertificateHash())
99
+ )
100
+
101
+
102
+ class TACTokenandPartiallySignedCertificateHash(univ.Sequence):
103
+ componentType = namedtype.NamedTypes(
104
+ namedtype.NamedType('token', Token()),
105
+ namedtype.NamedType('partially', PartiallySignedCertificateHash())
106
+ )
107
+
108
+
109
+ # Update the CMS Content Type Map
110
+
111
+ _cmsContentTypesMapUpdate = {
112
+ id_kisa_tac_token: TACToken(),
113
+ id_kisa_tac_tokenandblindbash: TACTokenandBlindHash(),
114
+ id_kisa_tac_tokenandpartially: TACTokenandPartiallySignedCertificateHash(),
115
+ }
116
+
117
+ cmsContentTypesMap.update(_cmsContentTypesMapUpdate)
@@ -0,0 +1,49 @@
1
+ # This file is part of pyasn1-alt-modules software.
2
+ #
3
+ # Created by Russ Housley.
4
+ #
5
+ # Copyright (c) 2019-2024, Vigil Security, LLC
6
+ # License: http://vigilsec.com/pyasn1-alt-modules-license.txt
7
+ #
8
+ # Elliptic Curve Cryptography Brainpool Standard Curves
9
+ #
10
+ # ASN.1 source from:
11
+ # https://www.rfc-editor.org/rfc/rfc5639.txt
12
+
13
+
14
+ from pyasn1.type import univ
15
+
16
+
17
+ ecStdCurvesAndGeneration = univ.ObjectIdentifier((1, 3, 36, 3, 3, 2, 8,))
18
+
19
+ ellipticCurve = ecStdCurvesAndGeneration + (1,)
20
+
21
+ versionOne = ellipticCurve + (1,)
22
+
23
+ brainpoolP160r1 = versionOne + (1,)
24
+
25
+ brainpoolP160t1 = versionOne + (2,)
26
+
27
+ brainpoolP192r1 = versionOne + (3,)
28
+
29
+ brainpoolP192t1 = versionOne + (4,)
30
+
31
+ brainpoolP224r1 = versionOne + (5,)
32
+
33
+ brainpoolP224t1 = versionOne + (6,)
34
+
35
+ brainpoolP256r1 = versionOne + (7,)
36
+
37
+ brainpoolP256t1 = versionOne + (8,)
38
+
39
+ brainpoolP320r1 = versionOne + (9,)
40
+
41
+ brainpoolP320t1 = versionOne + (10,)
42
+
43
+ brainpoolP384r1 = versionOne + (11,)
44
+
45
+ brainpoolP384t1 = versionOne + (12,)
46
+
47
+ brainpoolP512r1 = versionOne + (13,)
48
+
49
+ brainpoolP512t1 = versionOne + (14,)
@@ -0,0 +1,33 @@
1
+ # This file is part of pyasn1-alt-modules software.
2
+ #
3
+ # Created by Russ Housley.
4
+ #
5
+ # Copyright (c) 2019-2024, Vigil Security, LLC
6
+ # License: http://vigilsec.com/pyasn1-alt-modules-license.txt
7
+ #
8
+ # AES Key Wrap with Padding
9
+ #
10
+ # ASN.1 source from:
11
+ # https://www.rfc-editor.org/rfc/rfc5649.txt
12
+
13
+ from pyasn1.type import univ
14
+
15
+ from pyasn1_alt_modules import rfc5280
16
+
17
+
18
+ class AlgorithmIdentifier(rfc5280.AlgorithmIdentifier):
19
+ pass
20
+
21
+
22
+ id_aes128_wrap = univ.ObjectIdentifier('2.16.840.1.101.3.4.1.5')
23
+
24
+ id_aes192_wrap = univ.ObjectIdentifier('2.16.840.1.101.3.4.1.25')
25
+
26
+ id_aes256_wrap = univ.ObjectIdentifier('2.16.840.1.101.3.4.1.45')
27
+
28
+
29
+ id_aes128_wrap_pad = univ.ObjectIdentifier('2.16.840.1.101.3.4.1.8')
30
+
31
+ id_aes192_wrap_pad = univ.ObjectIdentifier('2.16.840.1.101.3.4.1.28')
32
+
33
+ id_aes256_wrap_pad = univ.ObjectIdentifier('2.16.840.1.101.3.4.1.48')