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,55 @@
|
|
|
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
|
+
# The scrypt Password-Based Key Derivation Function
|
|
11
|
+
#
|
|
12
|
+
# ASN.1 source from:
|
|
13
|
+
# https://www.rfc-editor.org/rfc/rfc8520.txt
|
|
14
|
+
# https://www.rfc-editor.org/errata/eid5871
|
|
15
|
+
#
|
|
16
|
+
|
|
17
|
+
from pyasn1.type import constraint
|
|
18
|
+
from pyasn1.type import namedtype
|
|
19
|
+
from pyasn1.type import univ
|
|
20
|
+
|
|
21
|
+
from pyasn1_alt_modules import opentypemap
|
|
22
|
+
|
|
23
|
+
algorithmIdentifierMap = opentypemap.get('algorithmIdentifierMap')
|
|
24
|
+
|
|
25
|
+
MAX = float('inf')
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# Algorithm identifier and parameters for the
|
|
29
|
+
# scrypt Password-Based Key Derivation Function
|
|
30
|
+
|
|
31
|
+
id_scrypt = univ.ObjectIdentifier('1.3.6.1.4.1.11591.4.11')
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class Scrypt_params(univ.Sequence):
|
|
35
|
+
componentType = namedtype.NamedTypes(
|
|
36
|
+
namedtype.NamedType('salt',
|
|
37
|
+
univ.OctetString()),
|
|
38
|
+
namedtype.NamedType('costParameter',
|
|
39
|
+
univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint(1, MAX))),
|
|
40
|
+
namedtype.NamedType('blockSize',
|
|
41
|
+
univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint(1, MAX))),
|
|
42
|
+
namedtype.NamedType('parallelizationParameter',
|
|
43
|
+
univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint(1, MAX))),
|
|
44
|
+
namedtype.OptionalNamedType('keyLength',
|
|
45
|
+
univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint(1, MAX)))
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
# Update the Algorithm Identifier Map and the S/MIME Capability Map
|
|
50
|
+
|
|
51
|
+
_algorithmIdentifierMapUpdate = {
|
|
52
|
+
id_scrypt: Scrypt_params(),
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
algorithmIdentifierMap.update(_algorithmIdentifierMapUpdate)
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file is part of pyasn1-alt-modules software.
|
|
3
|
+
#
|
|
4
|
+
# Created by Russ Housley.
|
|
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
|
+
# PKCS #1: RSA Cryptography Specifications Version 2.2
|
|
11
|
+
#
|
|
12
|
+
# ASN.1 source from:
|
|
13
|
+
# https://www.rfc-editor.org/rfc/rfc8017.txt
|
|
14
|
+
#
|
|
15
|
+
|
|
16
|
+
from pyasn1.type import constraint
|
|
17
|
+
from pyasn1.type import namedtype
|
|
18
|
+
from pyasn1.type import namedval
|
|
19
|
+
from pyasn1.type import univ
|
|
20
|
+
|
|
21
|
+
from pyasn1_alt_modules import rfc2437
|
|
22
|
+
from pyasn1_alt_modules import rfc3447
|
|
23
|
+
from pyasn1_alt_modules import rfc4055
|
|
24
|
+
from pyasn1_alt_modules import rfc5280
|
|
25
|
+
from pyasn1_alt_modules import opentypemap
|
|
26
|
+
|
|
27
|
+
algorithmIdentifierMap = opentypemap.get('algorithmIdentifierMap')
|
|
28
|
+
|
|
29
|
+
smimeCapabilityMap = opentypemap.get('smimeCapabilityMap')
|
|
30
|
+
|
|
31
|
+
MAX = float('inf')
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
# Import Algorithm Identifier from RFC 5280
|
|
35
|
+
|
|
36
|
+
AlgorithmIdentifier = rfc5280.AlgorithmIdentifier
|
|
37
|
+
|
|
38
|
+
class DigestAlgorithm(AlgorithmIdentifier):
|
|
39
|
+
pass
|
|
40
|
+
|
|
41
|
+
class HashAlgorithm(AlgorithmIdentifier):
|
|
42
|
+
pass
|
|
43
|
+
|
|
44
|
+
class MaskGenAlgorithm(AlgorithmIdentifier):
|
|
45
|
+
pass
|
|
46
|
+
|
|
47
|
+
class PSourceAlgorithm(AlgorithmIdentifier):
|
|
48
|
+
pass
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
# Object identifiers from NIST SHA2
|
|
52
|
+
|
|
53
|
+
hashAlgs = univ.ObjectIdentifier('2.16.840.1.101.3.4.2')
|
|
54
|
+
id_sha256 = rfc4055.id_sha256
|
|
55
|
+
id_sha384 = rfc4055.id_sha384
|
|
56
|
+
id_sha512 = rfc4055.id_sha512
|
|
57
|
+
id_sha224 = rfc4055.id_sha224
|
|
58
|
+
id_sha512_224 = hashAlgs + (5, )
|
|
59
|
+
id_sha512_256 = hashAlgs + (6, )
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
# Basic object identifiers
|
|
63
|
+
|
|
64
|
+
pkcs_1 = univ.ObjectIdentifier('1.2.840.113549.1.1')
|
|
65
|
+
rsaEncryption = rfc2437.rsaEncryption
|
|
66
|
+
id_RSAES_OAEP = rfc2437.id_RSAES_OAEP
|
|
67
|
+
id_pSpecified = rfc2437.id_pSpecified
|
|
68
|
+
id_RSASSA_PSS = rfc4055.id_RSASSA_PSS
|
|
69
|
+
md2WithRSAEncryption = rfc2437.md2WithRSAEncryption
|
|
70
|
+
md5WithRSAEncryption = rfc2437.md5WithRSAEncryption
|
|
71
|
+
sha1WithRSAEncryption = rfc2437.sha1WithRSAEncryption
|
|
72
|
+
sha224WithRSAEncryption = rfc4055.sha224WithRSAEncryption
|
|
73
|
+
sha256WithRSAEncryption = rfc4055.sha256WithRSAEncryption
|
|
74
|
+
sha384WithRSAEncryption = rfc4055.sha384WithRSAEncryption
|
|
75
|
+
sha512WithRSAEncryption = rfc4055.sha512WithRSAEncryption
|
|
76
|
+
sha512_224WithRSAEncryption = pkcs_1 + (15, )
|
|
77
|
+
sha512_256WithRSAEncryption = pkcs_1 + (16, )
|
|
78
|
+
id_sha1 = rfc2437.id_sha1
|
|
79
|
+
id_md2 = univ.ObjectIdentifier('1.2.840.113549.2.2')
|
|
80
|
+
id_md5 = univ.ObjectIdentifier('1.2.840.113549.2.5')
|
|
81
|
+
id_mgf1 = rfc2437.id_mgf1
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
# Default parameter values
|
|
85
|
+
|
|
86
|
+
sha1 = rfc4055.sha1Identifier
|
|
87
|
+
SHA1Parameters = univ.Null("")
|
|
88
|
+
|
|
89
|
+
mgf1SHA1 = rfc4055.mgf1SHA1Identifier
|
|
90
|
+
|
|
91
|
+
class EncodingParameters(univ.OctetString):
|
|
92
|
+
subtypeSpec = constraint.ValueSizeConstraint(0, MAX)
|
|
93
|
+
|
|
94
|
+
pSpecifiedEmpty = rfc4055.pSpecifiedEmptyIdentifier
|
|
95
|
+
|
|
96
|
+
emptyString = EncodingParameters(value='')
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
# Main structures
|
|
100
|
+
|
|
101
|
+
class Version(univ.Integer):
|
|
102
|
+
namedValues = namedval.NamedValues(
|
|
103
|
+
('two-prime', 0),
|
|
104
|
+
('multi', 1)
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
class TrailerField(univ.Integer):
|
|
108
|
+
namedValues = namedval.NamedValues(
|
|
109
|
+
('trailerFieldBC', 1)
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
RSAPublicKey = rfc2437.RSAPublicKey
|
|
113
|
+
|
|
114
|
+
OtherPrimeInfo = rfc3447.OtherPrimeInfo
|
|
115
|
+
OtherPrimeInfos = rfc3447.OtherPrimeInfos
|
|
116
|
+
RSAPrivateKey = rfc3447.RSAPrivateKey
|
|
117
|
+
|
|
118
|
+
RSAES_OAEP_params = rfc4055.RSAES_OAEP_params
|
|
119
|
+
rSAES_OAEP_Default_Identifier = rfc4055.rSAES_OAEP_Default_Identifier
|
|
120
|
+
|
|
121
|
+
RSASSA_PSS_params = rfc4055.RSASSA_PSS_params
|
|
122
|
+
rSASSA_PSS_Default_Identifier = rfc4055.rSASSA_PSS_Default_Identifier
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
# Syntax for the EMSA-PKCS1-v1_5 hash identifier
|
|
126
|
+
|
|
127
|
+
class DigestInfo(univ.Sequence):
|
|
128
|
+
componentType = namedtype.NamedTypes(
|
|
129
|
+
namedtype.NamedType('digestAlgorithm', DigestAlgorithm()),
|
|
130
|
+
namedtype.NamedType('digest', univ.OctetString())
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
# Update the Algorithm Identifier Map and the S/MIME Capability Map
|
|
135
|
+
|
|
136
|
+
_algorithmIdentifierMapUpdate = {
|
|
137
|
+
id_sha1: univ.Null(),
|
|
138
|
+
id_sha224: univ.Null(),
|
|
139
|
+
id_sha256: univ.Null(),
|
|
140
|
+
id_sha384: univ.Null(),
|
|
141
|
+
id_sha512: univ.Null(),
|
|
142
|
+
id_sha512_224: univ.Null(),
|
|
143
|
+
id_sha512_256: univ.Null(),
|
|
144
|
+
id_mgf1: AlgorithmIdentifier(),
|
|
145
|
+
id_pSpecified: univ.OctetString(),
|
|
146
|
+
id_RSAES_OAEP: RSAES_OAEP_params(),
|
|
147
|
+
id_RSASSA_PSS: RSASSA_PSS_params(),
|
|
148
|
+
md2WithRSAEncryption: univ.Null(),
|
|
149
|
+
md5WithRSAEncryption: univ.Null(),
|
|
150
|
+
sha1WithRSAEncryption: univ.Null(),
|
|
151
|
+
sha224WithRSAEncryption: univ.Null(),
|
|
152
|
+
sha256WithRSAEncryption: univ.Null(),
|
|
153
|
+
sha384WithRSAEncryption: univ.Null(),
|
|
154
|
+
sha512WithRSAEncryption: univ.Null(),
|
|
155
|
+
sha512_224WithRSAEncryption: univ.Null(),
|
|
156
|
+
sha512_256WithRSAEncryption: univ.Null(),
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
algorithmIdentifierMap.update(_algorithmIdentifierMapUpdate)
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file is part of pyasn1-alt-modules software.
|
|
3
|
+
#
|
|
4
|
+
# Created by Russ Housley.
|
|
5
|
+
# Modified by Russ Housley to include the opentypemap manager and
|
|
6
|
+
# update the S/MIME Capabilities map.
|
|
7
|
+
#
|
|
8
|
+
# Copyright (c) 2019-2024, Vigil Security, LLC
|
|
9
|
+
# License: http://vigilsec.com/pyasn1-alt-modules-license.txt
|
|
10
|
+
#
|
|
11
|
+
# PKCS #5: Password-Based Cryptography Specification, Version 2.1
|
|
12
|
+
#
|
|
13
|
+
# ASN.1 source from:
|
|
14
|
+
# https://www.rfc-editor.org/rfc/rfc8018.txt
|
|
15
|
+
#
|
|
16
|
+
|
|
17
|
+
from pyasn1.type import constraint
|
|
18
|
+
from pyasn1.type import namedtype
|
|
19
|
+
from pyasn1.type import namedval
|
|
20
|
+
from pyasn1.type import univ
|
|
21
|
+
|
|
22
|
+
from pyasn1_alt_modules import rfc3565
|
|
23
|
+
from pyasn1_alt_modules import rfc5280
|
|
24
|
+
from pyasn1_alt_modules import opentypemap
|
|
25
|
+
|
|
26
|
+
algorithmIdentifierMap = opentypemap.get('algorithmIdentifierMap')
|
|
27
|
+
|
|
28
|
+
smimeCapabilityMap = opentypemap.get('smimeCapabilityMap')
|
|
29
|
+
|
|
30
|
+
MAX = float('inf')
|
|
31
|
+
|
|
32
|
+
def _OID(*components):
|
|
33
|
+
output = []
|
|
34
|
+
for x in tuple(components):
|
|
35
|
+
if isinstance(x, univ.ObjectIdentifier):
|
|
36
|
+
output.extend(list(x))
|
|
37
|
+
else:
|
|
38
|
+
output.append(int(x))
|
|
39
|
+
|
|
40
|
+
return univ.ObjectIdentifier(output)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
# Import from RFC 3565
|
|
44
|
+
|
|
45
|
+
AES_IV = rfc3565.AES_IV
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
# Import from RFC 5280
|
|
49
|
+
|
|
50
|
+
AlgorithmIdentifier = rfc5280.AlgorithmIdentifier
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
# Basic object identifiers
|
|
54
|
+
|
|
55
|
+
nistAlgorithms = _OID(2, 16, 840, 1, 101, 3, 4)
|
|
56
|
+
|
|
57
|
+
aes = _OID(nistAlgorithms, 1)
|
|
58
|
+
|
|
59
|
+
oiw = _OID(1, 3, 14)
|
|
60
|
+
|
|
61
|
+
rsadsi = _OID(1, 2, 840, 113549)
|
|
62
|
+
|
|
63
|
+
pkcs = _OID(rsadsi, 1)
|
|
64
|
+
|
|
65
|
+
digestAlgorithm = _OID(rsadsi, 2)
|
|
66
|
+
|
|
67
|
+
encryptionAlgorithm = _OID(rsadsi, 3)
|
|
68
|
+
|
|
69
|
+
pkcs_5 = _OID(pkcs, 5)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
# HMAC object identifiers
|
|
74
|
+
|
|
75
|
+
id_hmacWithSHA1 = _OID(digestAlgorithm, 7)
|
|
76
|
+
|
|
77
|
+
id_hmacWithSHA224 = _OID(digestAlgorithm, 8)
|
|
78
|
+
|
|
79
|
+
id_hmacWithSHA256 = _OID(digestAlgorithm, 9)
|
|
80
|
+
|
|
81
|
+
id_hmacWithSHA384 = _OID(digestAlgorithm, 10)
|
|
82
|
+
|
|
83
|
+
id_hmacWithSHA512 = _OID(digestAlgorithm, 11)
|
|
84
|
+
|
|
85
|
+
id_hmacWithSHA512_224 = _OID(digestAlgorithm, 12)
|
|
86
|
+
|
|
87
|
+
id_hmacWithSHA512_256 = _OID(digestAlgorithm, 13)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
# PBES1 object identifiers
|
|
91
|
+
|
|
92
|
+
pbeWithMD2AndDES_CBC = _OID(pkcs_5, 1)
|
|
93
|
+
|
|
94
|
+
pbeWithMD2AndRC2_CBC = _OID(pkcs_5, 4)
|
|
95
|
+
|
|
96
|
+
pbeWithMD5AndDES_CBC = _OID(pkcs_5, 3)
|
|
97
|
+
|
|
98
|
+
pbeWithMD5AndRC2_CBC = _OID(pkcs_5, 6)
|
|
99
|
+
|
|
100
|
+
pbeWithSHA1AndDES_CBC = _OID(pkcs_5, 10)
|
|
101
|
+
|
|
102
|
+
pbeWithSHA1AndRC2_CBC = _OID(pkcs_5, 11)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
# Supporting techniques object identifiers
|
|
106
|
+
|
|
107
|
+
desCBC = _OID(oiw, 3, 2, 7)
|
|
108
|
+
|
|
109
|
+
des_EDE3_CBC = _OID(encryptionAlgorithm, 7)
|
|
110
|
+
|
|
111
|
+
rc2CBC = _OID(encryptionAlgorithm, 2)
|
|
112
|
+
|
|
113
|
+
rc5_CBC_PAD = _OID(encryptionAlgorithm, 9)
|
|
114
|
+
|
|
115
|
+
aes128_CBC_PAD = _OID(aes, 2)
|
|
116
|
+
|
|
117
|
+
aes192_CBC_PAD = _OID(aes, 22)
|
|
118
|
+
|
|
119
|
+
aes256_CBC_PAD = _OID(aes, 42)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
# PBES1
|
|
123
|
+
|
|
124
|
+
class PBEParameter(univ.Sequence):
|
|
125
|
+
pass
|
|
126
|
+
|
|
127
|
+
PBEParameter.componentType = namedtype.NamedTypes(
|
|
128
|
+
namedtype.NamedType('salt', univ.OctetString().subtype(
|
|
129
|
+
subtypeSpec=constraint.ValueSizeConstraint(8, 8))),
|
|
130
|
+
namedtype.NamedType('iterationCount', univ.Integer())
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
# PBES2
|
|
135
|
+
|
|
136
|
+
id_PBES2 = _OID(pkcs_5, 13)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
class PBES2_params(univ.Sequence):
|
|
140
|
+
pass
|
|
141
|
+
|
|
142
|
+
PBES2_params.componentType = namedtype.NamedTypes(
|
|
143
|
+
namedtype.NamedType('keyDerivationFunc', AlgorithmIdentifier()),
|
|
144
|
+
namedtype.NamedType('encryptionScheme', AlgorithmIdentifier())
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
# PBMAC1
|
|
149
|
+
|
|
150
|
+
id_PBMAC1 = _OID(pkcs_5, 14)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
class PBMAC1_params(univ.Sequence):
|
|
154
|
+
pass
|
|
155
|
+
|
|
156
|
+
PBMAC1_params.componentType = namedtype.NamedTypes(
|
|
157
|
+
namedtype.NamedType('keyDerivationFunc', AlgorithmIdentifier()),
|
|
158
|
+
namedtype.NamedType('messageAuthScheme', AlgorithmIdentifier())
|
|
159
|
+
)
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
# PBKDF2
|
|
163
|
+
|
|
164
|
+
id_PBKDF2 = _OID(pkcs_5, 12)
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
algid_hmacWithSHA1 = AlgorithmIdentifier()
|
|
168
|
+
algid_hmacWithSHA1['algorithm'] = id_hmacWithSHA1
|
|
169
|
+
algid_hmacWithSHA1['parameters'] = univ.Null("")
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
class PBKDF2_params(univ.Sequence):
|
|
173
|
+
pass
|
|
174
|
+
|
|
175
|
+
PBKDF2_params.componentType = namedtype.NamedTypes(
|
|
176
|
+
namedtype.NamedType('salt', univ.Choice(componentType=namedtype.NamedTypes(
|
|
177
|
+
namedtype.NamedType('specified', univ.OctetString()),
|
|
178
|
+
namedtype.NamedType('otherSource', AlgorithmIdentifier())
|
|
179
|
+
))),
|
|
180
|
+
namedtype.NamedType('iterationCount', univ.Integer().subtype(
|
|
181
|
+
subtypeSpec=constraint.ValueRangeConstraint(1, MAX))),
|
|
182
|
+
namedtype.OptionalNamedType('keyLength', univ.Integer().subtype(
|
|
183
|
+
subtypeSpec=constraint.ValueRangeConstraint(1, MAX))),
|
|
184
|
+
namedtype.DefaultedNamedType('prf', algid_hmacWithSHA1)
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
# RC2 CBC algorithm parameter
|
|
189
|
+
|
|
190
|
+
class RC2_CBC_Parameter(univ.Sequence):
|
|
191
|
+
pass
|
|
192
|
+
|
|
193
|
+
RC2_CBC_Parameter.componentType = namedtype.NamedTypes(
|
|
194
|
+
namedtype.OptionalNamedType('rc2ParameterVersion', univ.Integer()),
|
|
195
|
+
namedtype.NamedType('iv', univ.OctetString().subtype(
|
|
196
|
+
subtypeSpec=constraint.ValueSizeConstraint(8, 8)))
|
|
197
|
+
)
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
# RC5 CBC algorithm parameter
|
|
201
|
+
|
|
202
|
+
class RC5_CBC_Parameters(univ.Sequence):
|
|
203
|
+
pass
|
|
204
|
+
|
|
205
|
+
RC5_CBC_Parameters.componentType = namedtype.NamedTypes(
|
|
206
|
+
namedtype.NamedType('version',
|
|
207
|
+
univ.Integer(namedValues=namedval.NamedValues(('v1_0', 16))).subtype(
|
|
208
|
+
subtypeSpec=constraint.SingleValueConstraint(16))),
|
|
209
|
+
namedtype.NamedType('rounds',
|
|
210
|
+
univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint(8, 127))),
|
|
211
|
+
namedtype.NamedType('blockSizeInBits',
|
|
212
|
+
univ.Integer().subtype(subtypeSpec=constraint.SingleValueConstraint(64, 128))),
|
|
213
|
+
namedtype.OptionalNamedType('iv', univ.OctetString())
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
# Initialization Vector for AES: OCTET STRING (SIZE(16))
|
|
218
|
+
|
|
219
|
+
class AES_IV(univ.OctetString):
|
|
220
|
+
pass
|
|
221
|
+
|
|
222
|
+
AES_IV.subtypeSpec = constraint.ValueSizeConstraint(16, 16)
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
# Initialization Vector for DES: OCTET STRING (SIZE(8))
|
|
226
|
+
|
|
227
|
+
class DES_IV(univ.OctetString):
|
|
228
|
+
pass
|
|
229
|
+
|
|
230
|
+
DES_IV.subtypeSpec = constraint.ValueSizeConstraint(8, 8)
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
# Update the Algorithm Identifier map
|
|
234
|
+
|
|
235
|
+
_algorithmIdentifierMapUpdate = {
|
|
236
|
+
# PBKDF2-PRFs
|
|
237
|
+
id_hmacWithSHA1: univ.Null(),
|
|
238
|
+
id_hmacWithSHA224: univ.Null(),
|
|
239
|
+
id_hmacWithSHA256: univ.Null(),
|
|
240
|
+
id_hmacWithSHA384: univ.Null(),
|
|
241
|
+
id_hmacWithSHA512: univ.Null(),
|
|
242
|
+
id_hmacWithSHA512_224: univ.Null(),
|
|
243
|
+
id_hmacWithSHA512_256: univ.Null(),
|
|
244
|
+
# PBES1Algorithms
|
|
245
|
+
pbeWithMD2AndDES_CBC: PBEParameter(),
|
|
246
|
+
pbeWithMD2AndRC2_CBC: PBEParameter(),
|
|
247
|
+
pbeWithMD5AndDES_CBC: PBEParameter(),
|
|
248
|
+
pbeWithMD5AndRC2_CBC: PBEParameter(),
|
|
249
|
+
pbeWithSHA1AndDES_CBC: PBEParameter(),
|
|
250
|
+
pbeWithSHA1AndRC2_CBC: PBEParameter(),
|
|
251
|
+
# PBES2Algorithms
|
|
252
|
+
id_PBES2: PBES2_params(),
|
|
253
|
+
# PBES2-KDFs
|
|
254
|
+
id_PBKDF2: PBKDF2_params(),
|
|
255
|
+
# PBMAC1Algorithms
|
|
256
|
+
id_PBMAC1: PBMAC1_params(),
|
|
257
|
+
# SupportingAlgorithms
|
|
258
|
+
desCBC: DES_IV(),
|
|
259
|
+
des_EDE3_CBC: DES_IV(),
|
|
260
|
+
rc2CBC: RC2_CBC_Parameter(),
|
|
261
|
+
rc5_CBC_PAD: RC5_CBC_Parameters(),
|
|
262
|
+
aes128_CBC_PAD: AES_IV(),
|
|
263
|
+
aes192_CBC_PAD: AES_IV(),
|
|
264
|
+
aes256_CBC_PAD: AES_IV(),
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
algorithmIdentifierMap.update(_algorithmIdentifierMapUpdate)
|
|
268
|
+
|
|
269
|
+
smimeCapabilityMap.update(_algorithmIdentifierMapUpdate)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# This file is part of pyasn1-alt-modules software.
|
|
2
|
+
#
|
|
3
|
+
# Created by Russ Housley with assistance from the asn1ate tool.
|
|
4
|
+
# Auto-generated by asn1ate v.0.6.0 from rfc8103.asn.
|
|
5
|
+
#
|
|
6
|
+
# Copyright (c) 2019-2024, Vigil Security, LLC
|
|
7
|
+
# License: http://vigilsec.com/pyasn1-alt-modules-license.txt
|
|
8
|
+
#
|
|
9
|
+
# ChaCha20Poly1305 algorithm fo use with the Authenticated-Enveloped-Data
|
|
10
|
+
# protecting content type for the Cryptographic Message Syntax (CMS)
|
|
11
|
+
#
|
|
12
|
+
# ASN.1 source from:
|
|
13
|
+
# https://www.rfc-editor.org/rfc/rfc8103.txt
|
|
14
|
+
|
|
15
|
+
from pyasn1.type import constraint
|
|
16
|
+
from pyasn1.type import univ
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _OID(*components):
|
|
20
|
+
output = []
|
|
21
|
+
for x in tuple(components):
|
|
22
|
+
if isinstance(x, univ.ObjectIdentifier):
|
|
23
|
+
output.extend(list(x))
|
|
24
|
+
else:
|
|
25
|
+
output.append(int(x))
|
|
26
|
+
|
|
27
|
+
return univ.ObjectIdentifier(output)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class AEADChaCha20Poly1305Nonce(univ.OctetString):
|
|
31
|
+
pass
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
AEADChaCha20Poly1305Nonce.subtypeSpec = constraint.ValueSizeConstraint(12, 12)
|
|
35
|
+
|
|
36
|
+
id_alg_AEADChaCha20Poly1305 = _OID(1, 2, 840, 113549, 1, 9, 16, 3, 18)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file is part of pyasn1-alt-modules software.
|
|
3
|
+
#
|
|
4
|
+
# Created by Russ Housley.
|
|
5
|
+
#
|
|
6
|
+
# Copyright (c) 2019-2024, Vigil Security, LLC
|
|
7
|
+
# License: http://vigilsec.com/pyasn1-alt-modules-license.txt
|
|
8
|
+
#
|
|
9
|
+
# BGPsec Router PKI Profile
|
|
10
|
+
#
|
|
11
|
+
# ASN.1 source from:
|
|
12
|
+
# https://www.rfc-editor.org/rfc/rfc8209.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_bgpsec_router = id_kp + (30, )
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# This file is part of pyasn1-alt-modules software.
|
|
2
|
+
#
|
|
3
|
+
# Created by Russ Housley with assistance from the asn1ate tool, with manual
|
|
4
|
+
# changes to implement appropriate constraints and added comments.
|
|
5
|
+
# Modified by Russ Housley to add maps 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
|
+
# JWT Claim Constraints and TN Authorization List for certificate extensions.
|
|
12
|
+
#
|
|
13
|
+
# ASN.1 source from:
|
|
14
|
+
# https://www.rfc-editor.org/rfc/rfc8226.txt (with errata corrected)
|
|
15
|
+
|
|
16
|
+
from pyasn1.type import char
|
|
17
|
+
from pyasn1.type import constraint
|
|
18
|
+
from pyasn1.type import namedtype
|
|
19
|
+
from pyasn1.type import tag
|
|
20
|
+
from pyasn1.type import univ
|
|
21
|
+
|
|
22
|
+
from pyasn1_alt_modules import opentypemap
|
|
23
|
+
|
|
24
|
+
certificateExtensionsMap = opentypemap.get('certificateExtensionsMap')
|
|
25
|
+
|
|
26
|
+
MAX = float('inf')
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _OID(*components):
|
|
30
|
+
output = []
|
|
31
|
+
for x in tuple(components):
|
|
32
|
+
if isinstance(x, univ.ObjectIdentifier):
|
|
33
|
+
output.extend(list(x))
|
|
34
|
+
else:
|
|
35
|
+
output.append(int(x))
|
|
36
|
+
|
|
37
|
+
return univ.ObjectIdentifier(output)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class JWTClaimName(char.IA5String):
|
|
41
|
+
pass
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class JWTClaimNames(univ.SequenceOf):
|
|
45
|
+
pass
|
|
46
|
+
|
|
47
|
+
JWTClaimNames.componentType = JWTClaimName()
|
|
48
|
+
JWTClaimNames.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class JWTClaimPermittedValues(univ.Sequence):
|
|
52
|
+
pass
|
|
53
|
+
|
|
54
|
+
JWTClaimPermittedValues.componentType = namedtype.NamedTypes(
|
|
55
|
+
namedtype.NamedType('claim', JWTClaimName()),
|
|
56
|
+
namedtype.NamedType('permitted', univ.SequenceOf(
|
|
57
|
+
componentType=char.UTF8String()).subtype(
|
|
58
|
+
sizeSpec=constraint.ValueSizeConstraint(1, MAX)))
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class JWTClaimPermittedValuesList(univ.SequenceOf):
|
|
63
|
+
pass
|
|
64
|
+
|
|
65
|
+
JWTClaimPermittedValuesList.componentType = JWTClaimPermittedValues()
|
|
66
|
+
JWTClaimPermittedValuesList.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class JWTClaimConstraints(univ.Sequence):
|
|
70
|
+
pass
|
|
71
|
+
|
|
72
|
+
JWTClaimConstraints.componentType = namedtype.NamedTypes(
|
|
73
|
+
namedtype.OptionalNamedType('mustInclude',
|
|
74
|
+
JWTClaimNames().subtype(explicitTag=tag.Tag(tag.tagClassContext,
|
|
75
|
+
tag.tagFormatSimple, 0))),
|
|
76
|
+
namedtype.OptionalNamedType('permittedValues',
|
|
77
|
+
JWTClaimPermittedValuesList().subtype(explicitTag=tag.Tag(tag.tagClassContext,
|
|
78
|
+
tag.tagFormatSimple, 1)))
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
JWTClaimConstraints.subtypeSpec = constraint.ConstraintsUnion(
|
|
82
|
+
constraint.WithComponentsConstraint(
|
|
83
|
+
('mustInclude', constraint.ComponentPresentConstraint())),
|
|
84
|
+
constraint.WithComponentsConstraint(
|
|
85
|
+
('permittedValues', constraint.ComponentPresentConstraint()))
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
id_pe_JWTClaimConstraints = _OID(1, 3, 6, 1, 5, 5, 7, 1, 27)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
class ServiceProviderCode(char.IA5String):
|
|
93
|
+
pass
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
class TelephoneNumber(char.IA5String):
|
|
97
|
+
pass
|
|
98
|
+
|
|
99
|
+
TelephoneNumber.subtypeSpec = constraint.ConstraintsIntersection(
|
|
100
|
+
constraint.ValueSizeConstraint(1, 15),
|
|
101
|
+
constraint.PermittedAlphabetConstraint(
|
|
102
|
+
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '#', '*')
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
class TelephoneNumberRange(univ.Sequence):
|
|
107
|
+
pass
|
|
108
|
+
|
|
109
|
+
TelephoneNumberRange.componentType = namedtype.NamedTypes(
|
|
110
|
+
namedtype.NamedType('start', TelephoneNumber()),
|
|
111
|
+
namedtype.NamedType('count',
|
|
112
|
+
univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint(2, MAX)))
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
class TNEntry(univ.Choice):
|
|
117
|
+
pass
|
|
118
|
+
|
|
119
|
+
TNEntry.componentType = namedtype.NamedTypes(
|
|
120
|
+
namedtype.NamedType('spc',
|
|
121
|
+
ServiceProviderCode().subtype(explicitTag=tag.Tag(tag.tagClassContext,
|
|
122
|
+
tag.tagFormatSimple, 0))),
|
|
123
|
+
namedtype.NamedType('range',
|
|
124
|
+
TelephoneNumberRange().subtype(explicitTag=tag.Tag(tag.tagClassContext,
|
|
125
|
+
tag.tagFormatConstructed, 1))),
|
|
126
|
+
namedtype.NamedType('one',
|
|
127
|
+
TelephoneNumber().subtype(explicitTag=tag.Tag(tag.tagClassContext,
|
|
128
|
+
tag.tagFormatSimple, 2)))
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
class TNAuthorizationList(univ.SequenceOf):
|
|
133
|
+
pass
|
|
134
|
+
|
|
135
|
+
TNAuthorizationList.componentType = TNEntry()
|
|
136
|
+
TNAuthorizationList.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
|
|
137
|
+
|
|
138
|
+
id_pe_TNAuthList = _OID(1, 3, 6, 1, 5, 5, 7, 1, 26)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
id_ad_stirTNList = _OID(1, 3, 6, 1, 5, 5, 7, 48, 14)
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
# Update the Certificate Extension Map
|
|
145
|
+
|
|
146
|
+
_certificateExtensionsMapUpdate = {
|
|
147
|
+
id_pe_TNAuthList: TNAuthorizationList(),
|
|
148
|
+
id_pe_JWTClaimConstraints: JWTClaimConstraints(),
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
certificateExtensionsMap.update(_certificateExtensionsMapUpdate)
|