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,342 @@
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 add a map for use with opentypes.
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
+ # Enhanced Security Services for S/MIME
12
+ #
13
+ # ASN.1 source from:
14
+ # https://www.rfc-editor.org/rfc/rfc2634.txt
15
+ #
16
+
17
+ from pyasn1.type import char
18
+ from pyasn1.type import constraint
19
+ from pyasn1.type import namedval
20
+ from pyasn1.type import namedtype
21
+ from pyasn1.type import tag
22
+ from pyasn1.type import univ
23
+ from pyasn1.type import useful
24
+
25
+ from pyasn1_alt_modules import rfc5652
26
+ from pyasn1_alt_modules import rfc5280
27
+ from pyasn1_alt_modules import opentypemap
28
+
29
+ cmsAttributesMap = opentypemap.get('cmsAttributesMap')
30
+
31
+ cmsContentTypesMap = opentypemap.get('cmsContentTypesMap')
32
+
33
+ MAX = float('inf')
34
+
35
+ ContentType = rfc5652.ContentType
36
+
37
+ IssuerAndSerialNumber = rfc5652.IssuerAndSerialNumber
38
+
39
+ SubjectKeyIdentifier = rfc5652.SubjectKeyIdentifier
40
+
41
+ PolicyInformation = rfc5280.PolicyInformation
42
+
43
+ GeneralNames = rfc5280.GeneralNames
44
+
45
+ CertificateSerialNumber = rfc5280.CertificateSerialNumber
46
+
47
+
48
+ # Signing Certificate Attribute
49
+ # Warning: It is better to use SigningCertificateV2 from RFC 5035
50
+
51
+ id_aa_signingCertificate = univ.ObjectIdentifier('1.2.840.113549.1.9.16.2.12')
52
+
53
+ class Hash(univ.OctetString):
54
+ pass # SHA-1 hash of entire certificate; RFC 5035 supports other hash algorithms
55
+
56
+
57
+ class IssuerSerial(univ.Sequence):
58
+ pass
59
+
60
+ IssuerSerial.componentType = namedtype.NamedTypes(
61
+ namedtype.NamedType('issuer', GeneralNames()),
62
+ namedtype.NamedType('serialNumber', CertificateSerialNumber())
63
+ )
64
+
65
+
66
+ class ESSCertID(univ.Sequence):
67
+ pass
68
+
69
+ ESSCertID.componentType = namedtype.NamedTypes(
70
+ namedtype.NamedType('certHash', Hash()),
71
+ namedtype.OptionalNamedType('issuerSerial', IssuerSerial())
72
+ )
73
+
74
+
75
+ class SigningCertificate(univ.Sequence):
76
+ pass
77
+
78
+ SigningCertificate.componentType = namedtype.NamedTypes(
79
+ namedtype.NamedType('certs', univ.SequenceOf(
80
+ componentType=ESSCertID())),
81
+ namedtype.OptionalNamedType('policies', univ.SequenceOf(
82
+ componentType=PolicyInformation()))
83
+ )
84
+
85
+
86
+ # Mail List Expansion History Attribute
87
+
88
+ id_aa_mlExpandHistory = univ.ObjectIdentifier('1.2.840.113549.1.9.16.2.3')
89
+
90
+ ub_ml_expansion_history = univ.Integer(64)
91
+
92
+
93
+ class EntityIdentifier(univ.Choice):
94
+ pass
95
+
96
+ EntityIdentifier.componentType = namedtype.NamedTypes(
97
+ namedtype.NamedType('issuerAndSerialNumber', IssuerAndSerialNumber()),
98
+ namedtype.NamedType('subjectKeyIdentifier', SubjectKeyIdentifier())
99
+ )
100
+
101
+
102
+ class MLReceiptPolicy(univ.Choice):
103
+ pass
104
+
105
+ MLReceiptPolicy.componentType = namedtype.NamedTypes(
106
+ namedtype.NamedType('none', univ.Null().subtype(implicitTag=tag.Tag(
107
+ tag.tagClassContext, tag.tagFormatSimple, 0))),
108
+ namedtype.NamedType('insteadOf', univ.SequenceOf(
109
+ componentType=GeneralNames()).subtype(
110
+ sizeSpec=constraint.ValueSizeConstraint(1, MAX)).subtype(
111
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
112
+ namedtype.NamedType('inAdditionTo', univ.SequenceOf(
113
+ componentType=GeneralNames()).subtype(
114
+ sizeSpec=constraint.ValueSizeConstraint(1, MAX)).subtype(
115
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2)))
116
+ )
117
+
118
+
119
+ class MLData(univ.Sequence):
120
+ pass
121
+
122
+ MLData.componentType = namedtype.NamedTypes(
123
+ namedtype.NamedType('mailListIdentifier', EntityIdentifier()),
124
+ namedtype.NamedType('expansionTime', useful.GeneralizedTime()),
125
+ namedtype.OptionalNamedType('mlReceiptPolicy', MLReceiptPolicy())
126
+ )
127
+
128
+ class MLExpansionHistory(univ.SequenceOf):
129
+ pass
130
+
131
+ MLExpansionHistory.componentType = MLData()
132
+ MLExpansionHistory.sizeSpec = constraint.ValueSizeConstraint(1, ub_ml_expansion_history)
133
+
134
+
135
+ # ESS Security Label Attribute
136
+
137
+ id_aa_securityLabel = univ.ObjectIdentifier('1.2.840.113549.1.9.16.2.2')
138
+
139
+ ub_privacy_mark_length = univ.Integer(128)
140
+
141
+ ub_security_categories = univ.Integer(64)
142
+
143
+ ub_integer_options = univ.Integer(256)
144
+
145
+
146
+ class ESSPrivacyMark(univ.Choice):
147
+ pass
148
+
149
+ ESSPrivacyMark.componentType = namedtype.NamedTypes(
150
+ namedtype.NamedType('pString', char.PrintableString().subtype(
151
+ subtypeSpec=constraint.ValueSizeConstraint(1, ub_privacy_mark_length))),
152
+ namedtype.NamedType('utf8String', char.UTF8String().subtype(
153
+ subtypeSpec=constraint.ValueSizeConstraint(1, MAX)))
154
+ )
155
+
156
+
157
+ class SecurityClassification(univ.Integer):
158
+ pass
159
+
160
+ SecurityClassification.subtypeSpec=constraint.ValueRangeConstraint(0, ub_integer_options)
161
+
162
+ SecurityClassification.namedValues = namedval.NamedValues(
163
+ ('unmarked', 0),
164
+ ('unclassified', 1),
165
+ ('restricted', 2),
166
+ ('confidential', 3),
167
+ ('secret', 4),
168
+ ('top-secret', 5)
169
+ )
170
+
171
+
172
+ class SecurityPolicyIdentifier(univ.ObjectIdentifier):
173
+ pass
174
+
175
+
176
+ class SecurityCategory(univ.Sequence):
177
+ pass
178
+
179
+ SecurityCategory.componentType = namedtype.NamedTypes(
180
+ namedtype.NamedType('type', univ.ObjectIdentifier().subtype(
181
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
182
+ namedtype.NamedType('value', univ.Any().subtype(implicitTag=tag.Tag(
183
+ tag.tagClassContext, tag.tagFormatSimple, 1)))
184
+ )
185
+
186
+
187
+ class SecurityCategories(univ.SetOf):
188
+ pass
189
+
190
+ SecurityCategories.componentType = SecurityCategory()
191
+ SecurityCategories.sizeSpec = constraint.ValueSizeConstraint(1, ub_security_categories)
192
+
193
+
194
+ class ESSSecurityLabel(univ.Set):
195
+ pass
196
+
197
+ ESSSecurityLabel.componentType = namedtype.NamedTypes(
198
+ namedtype.NamedType('security-policy-identifier', SecurityPolicyIdentifier()),
199
+ namedtype.OptionalNamedType('security-classification', SecurityClassification()),
200
+ namedtype.OptionalNamedType('privacy-mark', ESSPrivacyMark()),
201
+ namedtype.OptionalNamedType('security-categories', SecurityCategories())
202
+ )
203
+
204
+
205
+ # Equivalent Labels Attribute
206
+
207
+ id_aa_equivalentLabels = univ.ObjectIdentifier('1.2.840.113549.1.9.16.2.9')
208
+
209
+ class EquivalentLabels(univ.SequenceOf):
210
+ pass
211
+
212
+ EquivalentLabels.componentType = ESSSecurityLabel()
213
+
214
+
215
+ # Content Identifier Attribute
216
+
217
+ id_aa_contentIdentifier = univ.ObjectIdentifier('1.2.840.113549.1.9.16.2.7')
218
+
219
+ class ContentIdentifier(univ.OctetString):
220
+ pass
221
+
222
+
223
+ # Content Reference Attribute
224
+
225
+ id_aa_contentReference = univ.ObjectIdentifier('1.2.840.113549.1.9.16.2.10')
226
+
227
+ class ContentReference(univ.Sequence):
228
+ pass
229
+
230
+ ContentReference.componentType = namedtype.NamedTypes(
231
+ namedtype.NamedType('contentType', ContentType()),
232
+ namedtype.NamedType('signedContentIdentifier', ContentIdentifier()),
233
+ namedtype.NamedType('originatorSignatureValue', univ.OctetString())
234
+ )
235
+
236
+
237
+ # Message Signature Digest Attribute
238
+
239
+ id_aa_msgSigDigest = univ.ObjectIdentifier('1.2.840.113549.1.9.16.2.5')
240
+
241
+ class MsgSigDigest(univ.OctetString):
242
+ pass
243
+
244
+
245
+ # Content Hints Attribute
246
+
247
+ id_aa_contentHint = univ.ObjectIdentifier('1.2.840.113549.1.9.16.2.4')
248
+
249
+ class ContentHints(univ.Sequence):
250
+ pass
251
+
252
+ ContentHints.componentType = namedtype.NamedTypes(
253
+ namedtype.OptionalNamedType('contentDescription', char.UTF8String().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, MAX))),
254
+ namedtype.NamedType('contentType', ContentType())
255
+ )
256
+
257
+
258
+ # Receipt Request Attribute
259
+
260
+ class AllOrFirstTier(univ.Integer):
261
+ pass
262
+
263
+ AllOrFirstTier.namedValues = namedval.NamedValues(
264
+ ('allReceipts', 0),
265
+ ('firstTierRecipients', 1)
266
+ )
267
+
268
+
269
+ class ReceiptsFrom(univ.Choice):
270
+ pass
271
+
272
+ ReceiptsFrom.componentType = namedtype.NamedTypes(
273
+ namedtype.NamedType('allOrFirstTier', AllOrFirstTier().subtype(
274
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
275
+ namedtype.NamedType('receiptList', univ.SequenceOf(
276
+ componentType=GeneralNames()).subtype(implicitTag=tag.Tag(
277
+ tag.tagClassContext, tag.tagFormatSimple, 1)))
278
+ )
279
+
280
+
281
+ id_aa_receiptRequest = univ.ObjectIdentifier('1.2.840.113549.1.9.16.2.1')
282
+
283
+ ub_receiptsTo = univ.Integer(16)
284
+
285
+ class ReceiptRequest(univ.Sequence):
286
+ pass
287
+
288
+ ReceiptRequest.componentType = namedtype.NamedTypes(
289
+ namedtype.NamedType('signedContentIdentifier', ContentIdentifier()),
290
+ namedtype.NamedType('receiptsFrom', ReceiptsFrom()),
291
+ namedtype.NamedType('receiptsTo', univ.SequenceOf(componentType=GeneralNames()).subtype(sizeSpec=constraint.ValueSizeConstraint(1, ub_receiptsTo)))
292
+ )
293
+
294
+ # Receipt Content Type
295
+
296
+ class ESSVersion(univ.Integer):
297
+ pass
298
+
299
+ ESSVersion.namedValues = namedval.NamedValues(
300
+ ('v1', 1)
301
+ )
302
+
303
+
304
+ id_ct_receipt = univ.ObjectIdentifier('1.2.840.113549.1.9.16.1.1')
305
+
306
+ class Receipt(univ.Sequence):
307
+ pass
308
+
309
+ Receipt.componentType = namedtype.NamedTypes(
310
+ namedtype.NamedType('version', ESSVersion()),
311
+ namedtype.NamedType('contentType', ContentType()),
312
+ namedtype.NamedType('signedContentIdentifier', ContentIdentifier()),
313
+ namedtype.NamedType('originatorSignatureValue', univ.OctetString())
314
+ )
315
+
316
+
317
+ # Map of Attribute Type to the Attribute structure is added to the
318
+ # ones that are in rfc5652.py
319
+
320
+ _cmsAttributesMapUpdate = {
321
+ id_aa_signingCertificate: SigningCertificate(),
322
+ id_aa_mlExpandHistory: MLExpansionHistory(),
323
+ id_aa_securityLabel: ESSSecurityLabel(),
324
+ id_aa_equivalentLabels: EquivalentLabels(),
325
+ id_aa_contentIdentifier: ContentIdentifier(),
326
+ id_aa_contentReference: ContentReference(),
327
+ id_aa_msgSigDigest: MsgSigDigest(),
328
+ id_aa_contentHint: ContentHints(),
329
+ id_aa_receiptRequest: ReceiptRequest(),
330
+ }
331
+
332
+ cmsAttributesMap.update(_cmsAttributesMapUpdate)
333
+
334
+
335
+ # Map of Content Type OIDs to Content Types is added to the
336
+ # ones that are in rfc5652.py
337
+
338
+ _cmsContentTypesMapUpdate = {
339
+ id_ct_receipt: Receipt(),
340
+ }
341
+
342
+ cmsContentTypesMap.update(_cmsContentTypesMapUpdate)
@@ -0,0 +1,60 @@
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) 2021-2024, Vigil Security, LLC
7
+ # License: http://vigilsec.com/pyasn1-alt-modules-license.txt
8
+ #
9
+ # GSS-API Tokens
10
+ #
11
+ # ASN.1 source from:
12
+ # https://www.rfc-editor.org/rfc/rfc2743.txt
13
+ #
14
+
15
+ from pyasn1.type import namedtype
16
+ from pyasn1.type import namedval
17
+ from pyasn1.type import opentype
18
+ from pyasn1.type import tag
19
+ from pyasn1.type import univ
20
+
21
+ from pyasn1_alt_modules import opentypemap
22
+
23
+ gssapiMechTypeMap = opentypemap.get('gssapiMechTypeMap')
24
+
25
+
26
+ class PerMsgToken(univ.Any):
27
+ pass
28
+
29
+
30
+ class SealedMessage(univ.Any):
31
+ pass
32
+
33
+
34
+ class SubsequentContextToken(univ.Any):
35
+ pass
36
+
37
+
38
+ class MechType(univ.ObjectIdentifier):
39
+ pass
40
+
41
+
42
+ class InitialContextToken(univ.Sequence):
43
+ pass
44
+
45
+ InitialContextToken.tagSet = univ.Sequence.tagSet.tagImplicitly(
46
+ tag.Tag(tag.tagClassApplication, tag.tagFormatConstructed, 0)
47
+ )
48
+
49
+ InitialContextToken.componentType = namedtype.NamedTypes(
50
+ namedtype.NamedType('thisMech', MechType()),
51
+ namedtype.NamedType('innerContextToken', univ.Any(),
52
+ openType=opentype.OpenType('thisMech', gssapiMechTypeMap)
53
+ )
54
+ )
55
+
56
+
57
+ # For DASS (RFC 1507), the MechType is 1.3.12.2.1011.7.5.
58
+ # For Kerberos V5 (RFC 1964), the MechType is 1.2.840.113554.1.2.2.
59
+ # If modules are ever written for these RFCs, the module should add
60
+ # entries for these object identifiers to gssapiMechTypeMap.
@@ -0,0 +1,61 @@
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
+ # KEA and SKIPJACK Algorithms in CMS
11
+ #
12
+ # ASN.1 source from:
13
+ # https://www.rfc-editor.org/rfc/rfc2876.txt
14
+ #
15
+
16
+ from pyasn1.type import namedtype
17
+ from pyasn1.type import univ
18
+
19
+ from pyasn1_alt_modules import rfc5280
20
+ from pyasn1_alt_modules import opentypemap
21
+
22
+ algorithmIdentifierMap = opentypemap.get('algorithmIdentifierMap')
23
+
24
+ smimeCapabilityMap = opentypemap.get('smimeCapabilityMap')
25
+
26
+
27
+ id_fortezzaConfidentialityAlgorithm = univ.ObjectIdentifier('2.16.840.1.101.2.1.1.4')
28
+
29
+
30
+ id_fortezzaWrap80 = univ.ObjectIdentifier('2.16.840.1.101.2.1.1.23')
31
+
32
+
33
+ id_kEAKeyEncryptionAlgorithm = univ.ObjectIdentifier('2.16.840.1.101.2.1.1.24')
34
+
35
+
36
+ id_keyExchangeAlgorithm = univ.ObjectIdentifier('2.16.840.1.101.2.1.1.22')
37
+
38
+
39
+ class Skipjack_Parm(univ.Sequence):
40
+ componentType = namedtype.NamedTypes(
41
+ namedtype.NamedType('initialization-vector', univ.OctetString())
42
+ )
43
+
44
+
45
+ # Update the Algorithm Identifier map
46
+
47
+ _algorithmIdentifierMapUpdate = {
48
+ id_fortezzaConfidentialityAlgorithm: Skipjack_Parm(),
49
+ id_kEAKeyEncryptionAlgorithm: rfc5280.AlgorithmIdentifier(),
50
+ }
51
+
52
+ algorithmIdentifierMap.update(_algorithmIdentifierMapUpdate)
53
+
54
+
55
+ # Update the S/MIME Capability map
56
+
57
+ _smimeCapabilityMapUpdate = {
58
+ id_kEAKeyEncryptionAlgorithm: rfc5280.AlgorithmIdentifier(),
59
+ }
60
+
61
+ smimeCapabilityMap.update(_smimeCapabilityMapUpdate)
@@ -0,0 +1,72 @@
1
+ #
2
+ # This file is part of pyasn1-alt-modules software.
3
+ #
4
+ # Created by Russ Housley.
5
+ #
6
+ # Copyright (c) 2022-2024, Vigil Security, LLC
7
+ # License: http://vigilsec.com/pyasn1-alt-modules-license.txt
8
+ #
9
+ # PKCS #5: Password-Based Cryptography Specification, Version 2.0
10
+ #
11
+ # ASN.1 source from:
12
+ # https://www.rfc-editor.org/rfc/rfc2898.txt
13
+ # https://www.rfc-editor.org/rfc/rfc8018.txt
14
+ #
15
+
16
+ from pyasn1_alt_modules import rfc8018
17
+
18
+
19
+ # PKCS#5 Version 2.1 is backward compatible with PKCS#5 Version 2.0,
20
+ # so all of the definitions can be imported from the newer document.
21
+
22
+ rsadsi = rfc8018.rsadsi
23
+
24
+ pkcs = rfc8018.pkcs
25
+
26
+ digestAlgorithm = rfc8018.digestAlgorithm
27
+
28
+ encryptionAlgorithm = rfc8018.encryptionAlgorithm
29
+
30
+ pkcs_5 = rfc8018.pkcs_5
31
+
32
+ id_PBKDF2 = rfc8018.id_PBKDF2
33
+
34
+ PBKDF2_params = rfc8018.PBKDF2_params
35
+
36
+ id_hmacWithSHA1 = rfc8018.id_hmacWithSHA1
37
+
38
+ algid_hmacWithSHA1 = rfc8018.algid_hmacWithSHA1
39
+
40
+ pbeWithMD2AndDES_CBC = rfc8018.pbeWithMD2AndDES_CBC
41
+
42
+ pbeWithMD2AndRC2_CBC = rfc8018.pbeWithMD2AndRC2_CBC
43
+
44
+ pbeWithMD5AndDES_CBC = rfc8018.pbeWithMD5AndDES_CBC
45
+
46
+ pbeWithMD5AndRC2_CBC = rfc8018.pbeWithMD5AndRC2_CBC
47
+
48
+ pbeWithSHA1AndDES_CBC = rfc8018.pbeWithSHA1AndDES_CBC
49
+
50
+ pbeWithSHA1AndRC2_CBC = rfc8018.pbeWithSHA1AndRC2_CBC
51
+
52
+ PBEParameter = rfc8018.PBEParameter
53
+
54
+ id_PBES2 = rfc8018.id_PBES2
55
+
56
+ PBES2_params = rfc8018.PBES2_params
57
+
58
+ id_PBMAC1 = rfc8018.id_PBMAC1
59
+
60
+ PBMAC1_params = rfc8018.PBMAC1_params
61
+
62
+ desCBC = rfc8018.desCBC
63
+
64
+ des_EDE3_CBC = rfc8018.des_EDE3_CBC
65
+
66
+ rc2CBC = rfc8018.rc2CBC
67
+
68
+ RC2_CBC_Parameter = rfc8018.RC2_CBC_Parameter
69
+
70
+ rc5_CBC_PAD = rfc8018.rc5_CBC_PAD
71
+
72
+ RC5_CBC_Parameters = rfc8018.RC5_CBC_Parameters