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.
- pyasn1_alt_modules/__init__.py +2 -0
- pyasn1_alt_modules/opentypemap.py +19 -0
- pyasn1_alt_modules/pem.py +66 -0
- pyasn1_alt_modules/rfc1155.py +97 -0
- pyasn1_alt_modules/rfc1157.py +127 -0
- pyasn1_alt_modules/rfc1901.py +23 -0
- pyasn1_alt_modules/rfc1902.py +130 -0
- pyasn1_alt_modules/rfc1905.py +136 -0
- pyasn1_alt_modules/rfc2040.py +50 -0
- pyasn1_alt_modules/rfc2251.py +564 -0
- pyasn1_alt_modules/rfc2314.py +68 -0
- pyasn1_alt_modules/rfc2315.py +325 -0
- pyasn1_alt_modules/rfc2437.py +70 -0
- pyasn1_alt_modules/rfc2459.py +1340 -0
- pyasn1_alt_modules/rfc2511.py +303 -0
- pyasn1_alt_modules/rfc2528.py +34 -0
- pyasn1_alt_modules/rfc2560.py +226 -0
- pyasn1_alt_modules/rfc2631.py +37 -0
- pyasn1_alt_modules/rfc2634.py +342 -0
- pyasn1_alt_modules/rfc2743.py +60 -0
- pyasn1_alt_modules/rfc2876.py +61 -0
- pyasn1_alt_modules/rfc2898.py +72 -0
- pyasn1_alt_modules/rfc2985.py +593 -0
- pyasn1_alt_modules/rfc2986.py +76 -0
- pyasn1_alt_modules/rfc3058.py +48 -0
- pyasn1_alt_modules/rfc3114.py +80 -0
- pyasn1_alt_modules/rfc3125.py +469 -0
- pyasn1_alt_modules/rfc3161.py +142 -0
- pyasn1_alt_modules/rfc3217.py +42 -0
- pyasn1_alt_modules/rfc3274.py +62 -0
- pyasn1_alt_modules/rfc3279.py +264 -0
- pyasn1_alt_modules/rfc3280.py +1544 -0
- pyasn1_alt_modules/rfc3281.py +332 -0
- pyasn1_alt_modules/rfc3370.py +142 -0
- pyasn1_alt_modules/rfc3412.py +54 -0
- pyasn1_alt_modules/rfc3414.py +29 -0
- pyasn1_alt_modules/rfc3447.py +46 -0
- pyasn1_alt_modules/rfc3537.py +44 -0
- pyasn1_alt_modules/rfc3546.py +23 -0
- pyasn1_alt_modules/rfc3560.py +74 -0
- pyasn1_alt_modules/rfc3565.py +59 -0
- pyasn1_alt_modules/rfc3657.py +69 -0
- pyasn1_alt_modules/rfc3709.py +230 -0
- pyasn1_alt_modules/rfc3739.py +207 -0
- pyasn1_alt_modules/rfc3770.py +77 -0
- pyasn1_alt_modules/rfc3779.py +139 -0
- pyasn1_alt_modules/rfc3820.py +66 -0
- pyasn1_alt_modules/rfc3852.py +707 -0
- pyasn1_alt_modules/rfc3874.py +29 -0
- pyasn1_alt_modules/rfc4010.py +58 -0
- pyasn1_alt_modules/rfc4043.py +45 -0
- pyasn1_alt_modules/rfc4055.py +285 -0
- pyasn1_alt_modules/rfc4056.py +56 -0
- pyasn1_alt_modules/rfc4059.py +101 -0
- pyasn1_alt_modules/rfc4073.py +62 -0
- pyasn1_alt_modules/rfc4108.py +355 -0
- pyasn1_alt_modules/rfc4210.py +807 -0
- pyasn1_alt_modules/rfc4211.py +420 -0
- pyasn1_alt_modules/rfc4231.py +38 -0
- pyasn1_alt_modules/rfc4262.py +37 -0
- pyasn1_alt_modules/rfc4334.py +78 -0
- pyasn1_alt_modules/rfc4357.py +485 -0
- pyasn1_alt_modules/rfc4366.py +23 -0
- pyasn1_alt_modules/rfc4387.py +23 -0
- pyasn1_alt_modules/rfc4476.py +99 -0
- pyasn1_alt_modules/rfc4490.py +119 -0
- pyasn1_alt_modules/rfc4491.py +44 -0
- pyasn1_alt_modules/rfc4683.py +76 -0
- pyasn1_alt_modules/rfc4985.py +52 -0
- pyasn1_alt_modules/rfc4998.py +125 -0
- pyasn1_alt_modules/rfc5035.py +206 -0
- pyasn1_alt_modules/rfc5055.py +763 -0
- pyasn1_alt_modules/rfc5083.py +55 -0
- pyasn1_alt_modules/rfc5084.py +94 -0
- pyasn1_alt_modules/rfc5126.py +578 -0
- pyasn1_alt_modules/rfc5208.py +73 -0
- pyasn1_alt_modules/rfc5275.py +404 -0
- pyasn1_alt_modules/rfc5276.py +82 -0
- pyasn1_alt_modules/rfc5280.py +1666 -0
- pyasn1_alt_modules/rfc5480.py +190 -0
- pyasn1_alt_modules/rfc5544.py +127 -0
- pyasn1_alt_modules/rfc5636.py +117 -0
- pyasn1_alt_modules/rfc5639.py +49 -0
- pyasn1_alt_modules/rfc5649.py +33 -0
- pyasn1_alt_modules/rfc5652.py +763 -0
- pyasn1_alt_modules/rfc5697.py +64 -0
- pyasn1_alt_modules/rfc5698.py +159 -0
- pyasn1_alt_modules/rfc5751.py +127 -0
- pyasn1_alt_modules/rfc5752.py +52 -0
- pyasn1_alt_modules/rfc5753.py +163 -0
- pyasn1_alt_modules/rfc5755.py +400 -0
- pyasn1_alt_modules/rfc5913.py +46 -0
- pyasn1_alt_modules/rfc5914.py +119 -0
- pyasn1_alt_modules/rfc5915.py +32 -0
- pyasn1_alt_modules/rfc5916.py +39 -0
- pyasn1_alt_modules/rfc5917.py +59 -0
- pyasn1_alt_modules/rfc5924.py +19 -0
- pyasn1_alt_modules/rfc5934.py +786 -0
- pyasn1_alt_modules/rfc5940.py +62 -0
- pyasn1_alt_modules/rfc5958.py +100 -0
- pyasn1_alt_modules/rfc5990.py +238 -0
- pyasn1_alt_modules/rfc6010.py +92 -0
- pyasn1_alt_modules/rfc6019.py +46 -0
- pyasn1_alt_modules/rfc6031.py +469 -0
- pyasn1_alt_modules/rfc6032.py +71 -0
- pyasn1_alt_modules/rfc6066.py +25 -0
- pyasn1_alt_modules/rfc6120.py +46 -0
- pyasn1_alt_modules/rfc6170.py +17 -0
- pyasn1_alt_modules/rfc6187.py +22 -0
- pyasn1_alt_modules/rfc6210.py +45 -0
- pyasn1_alt_modules/rfc6211.py +75 -0
- pyasn1_alt_modules/rfc6402.py +643 -0
- pyasn1_alt_modules/rfc6482.py +77 -0
- pyasn1_alt_modules/rfc6484.py +17 -0
- pyasn1_alt_modules/rfc6486.py +70 -0
- pyasn1_alt_modules/rfc6487.py +22 -0
- pyasn1_alt_modules/rfc6492.py +41 -0
- pyasn1_alt_modules/rfc6493.py +24 -0
- pyasn1_alt_modules/rfc6494.py +23 -0
- pyasn1_alt_modules/rfc6664.py +151 -0
- pyasn1_alt_modules/rfc6955.py +112 -0
- pyasn1_alt_modules/rfc6960.py +234 -0
- pyasn1_alt_modules/rfc6962.py +52 -0
- pyasn1_alt_modules/rfc7030.py +70 -0
- pyasn1_alt_modules/rfc7191.py +267 -0
- pyasn1_alt_modules/rfc7229.py +29 -0
- pyasn1_alt_modules/rfc7292.py +359 -0
- pyasn1_alt_modules/rfc7296.py +32 -0
- pyasn1_alt_modules/rfc7508.py +92 -0
- pyasn1_alt_modules/rfc7585.py +53 -0
- pyasn1_alt_modules/rfc7633.py +40 -0
- pyasn1_alt_modules/rfc7693.py +66 -0
- pyasn1_alt_modules/rfc7773.py +54 -0
- pyasn1_alt_modules/rfc7836.py +65 -0
- pyasn1_alt_modules/rfc7894.py +100 -0
- pyasn1_alt_modules/rfc7906.py +739 -0
- pyasn1_alt_modules/rfc7914.py +55 -0
- pyasn1_alt_modules/rfc8017.py +159 -0
- pyasn1_alt_modules/rfc8018.py +269 -0
- pyasn1_alt_modules/rfc8103.py +36 -0
- pyasn1_alt_modules/rfc8209.py +20 -0
- pyasn1_alt_modules/rfc8226.py +151 -0
- pyasn1_alt_modules/rfc8358.py +54 -0
- pyasn1_alt_modules/rfc8360.py +46 -0
- pyasn1_alt_modules/rfc8398.py +55 -0
- pyasn1_alt_modules/rfc8410.py +43 -0
- pyasn1_alt_modules/rfc8418.py +36 -0
- pyasn1_alt_modules/rfc8419.py +70 -0
- pyasn1_alt_modules/rfc8479.py +48 -0
- pyasn1_alt_modules/rfc8494.py +80 -0
- pyasn1_alt_modules/rfc8520.py +66 -0
- pyasn1_alt_modules/rfc8619.py +45 -0
- pyasn1_alt_modules/rfc8649.py +42 -0
- pyasn1_alt_modules/rfc8692.py +79 -0
- pyasn1_alt_modules/rfc8696.py +108 -0
- pyasn1_alt_modules/rfc8702.py +109 -0
- pyasn1_alt_modules/rfc8708.py +43 -0
- pyasn1_alt_modules/rfc8737.py +36 -0
- pyasn1_alt_modules/rfc8769.py +21 -0
- pyasn1_alt_modules/rfc8894.py +52 -0
- pyasn1_alt_modules/rfc8951.py +42 -0
- pyasn1_alt_modules/rfc8954.py +238 -0
- pyasn1_alt_modules/rfc8994.py +52 -0
- pyasn1_alt_modules/rfc8995.py +39 -0
- pyasn1_alt_modules/rfc9044.py +80 -0
- pyasn1_alt_modules/rfc9092.py +35 -0
- pyasn1_alt_modules/rfc9118.py +82 -0
- pyasn1_alt_modules/rfc9174.py +55 -0
- pyasn1_alt_modules/rfc9189.py +74 -0
- pyasn1_alt_modules/rfc9215.py +228 -0
- pyasn1_alt_modules/rfc9286.py +78 -0
- pyasn1_alt_modules/rfc9289.py +22 -0
- pyasn1_alt_modules/rfc9310.py +46 -0
- pyasn1_alt_modules/rfc9323.py +129 -0
- pyasn1_alt_modules/rfc9336.py +20 -0
- pyasn1_alt_modules/rfc9337.py +74 -0
- pyasn1_alt_modules/rfc9345.py +36 -0
- pyasn1_alt_modules/rfc9385.py +22 -0
- pyasn1_alt_modules/rfc9399.py +59 -0
- pyasn1_alt_modules/rfc9480.py +731 -0
- pyasn1_alt_modules/rfc9481.py +224 -0
- pyasn1_alt_modules/rfc9509.py +24 -0
- pyasn1_alt_modules/rfc9548.py +23 -0
- pyasn1_alt_modules/rfc9579.py +89 -0
- pyasn1_alt_modules/rfc9582.py +107 -0
- pyasn1_alt_modules/rfc9598.py +52 -0
- pyasn1_alt_modules/rfc9608.py +35 -0
- pyasn1_alt_modules/rfc9629.py +100 -0
- pyasn1_alt_modules/rfc9654.py +241 -0
- pyasn1_alt_modules-0.4.5.dist-info/LICENSE.txt +25 -0
- pyasn1_alt_modules-0.4.5.dist-info/METADATA +34 -0
- pyasn1_alt_modules-0.4.5.dist-info/RECORD +195 -0
- pyasn1_alt_modules-0.4.5.dist-info/WHEEL +5 -0
- pyasn1_alt_modules-0.4.5.dist-info/top_level.txt +1 -0
- 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
|