@pairling/runtime-darwin-x64 0.2.0 → 0.2.2
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.
- package/README.md +1 -1
- package/bin/pairling-connectd +0 -0
- package/manifest.json +4 -4
- package/package.json +3 -3
- package/python/bin/python3 +0 -0
- package/python/bin/python3.12 +0 -0
- package/python/lib/libpython3.12.dylib +0 -0
- package/python/lib/python3.12/lib-dynload/_crypt.cpython-312-darwin.so +0 -0
- package/python/lib/python3.12/lib-dynload/_dbm.cpython-312-darwin.so +0 -0
- package/python/lib/python3.12/site-packages/_cffi_backend.cpython-312-darwin.so +0 -0
- package/python/lib/python3.12/site-packages/cffi/__init__.py +14 -0
- package/python/lib/python3.12/site-packages/cffi/_cffi_errors.h +149 -0
- package/python/lib/python3.12/site-packages/cffi/_cffi_include.h +389 -0
- package/python/lib/python3.12/site-packages/cffi/_embedding.h +550 -0
- package/python/lib/python3.12/site-packages/cffi/_imp_emulation.py +83 -0
- package/python/lib/python3.12/site-packages/cffi/_shimmed_dist_utils.py +45 -0
- package/python/lib/python3.12/site-packages/cffi/api.py +967 -0
- package/python/lib/python3.12/site-packages/cffi/backend_ctypes.py +1121 -0
- package/python/lib/python3.12/site-packages/cffi/cffi_opcode.py +187 -0
- package/python/lib/python3.12/site-packages/cffi/commontypes.py +82 -0
- package/python/lib/python3.12/site-packages/cffi/cparser.py +1015 -0
- package/python/lib/python3.12/site-packages/cffi/error.py +31 -0
- package/python/lib/python3.12/site-packages/cffi/ffiplatform.py +113 -0
- package/python/lib/python3.12/site-packages/cffi/lock.py +30 -0
- package/python/lib/python3.12/site-packages/cffi/model.py +618 -0
- package/python/lib/python3.12/site-packages/cffi/parse_c_type.h +181 -0
- package/python/lib/python3.12/site-packages/cffi/pkgconfig.py +121 -0
- package/python/lib/python3.12/site-packages/cffi/recompiler.py +1598 -0
- package/python/lib/python3.12/site-packages/cffi/setuptools_ext.py +216 -0
- package/python/lib/python3.12/site-packages/cffi/vengine_cpy.py +1084 -0
- package/python/lib/python3.12/site-packages/cffi/vengine_gen.py +679 -0
- package/python/lib/python3.12/site-packages/cffi/verifier.py +306 -0
- package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/INSTALLER +1 -0
- package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/LICENSE +26 -0
- package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/METADATA +40 -0
- package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/RECORD +30 -0
- package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/WHEEL +5 -0
- package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/entry_points.txt +2 -0
- package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/top_level.txt +2 -0
- package/python/lib/python3.12/site-packages/cryptography/__about__.py +17 -0
- package/python/lib/python3.12/site-packages/cryptography/__init__.py +26 -0
- package/python/lib/python3.12/site-packages/cryptography/exceptions.py +52 -0
- package/python/lib/python3.12/site-packages/cryptography/fernet.py +224 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/__init__.py +13 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/_oid.py +348 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/backends/__init__.py +13 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/backends/openssl/__init__.py +9 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/backends/openssl/backend.py +308 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/__init__.py +3 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/__init__.pyi +37 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/_openssl.pyi +8 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/asn1.pyi +7 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/exceptions.pyi +17 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/ocsp.pyi +117 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/__init__.pyi +75 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/aead.pyi +107 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ciphers.pyi +38 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/cmac.pyi +18 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/dh.pyi +51 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/dsa.pyi +41 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ec.pyi +52 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ed25519.pyi +13 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ed448.pyi +13 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/hashes.pyi +28 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/hmac.pyi +22 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/kdf.pyi +49 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/keys.pyi +34 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/poly1305.pyi +15 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/rsa.pyi +55 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/x25519.pyi +13 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/x448.pyi +13 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/pkcs12.pyi +52 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/pkcs7.pyi +50 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/test_support.pyi +23 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/x509.pyi +313 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust.abi3.so +0 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/__init__.py +3 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/_conditional.py +191 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/binding.py +122 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/decrepit/__init__.py +5 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/decrepit/ciphers/__init__.py +5 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/decrepit/ciphers/algorithms.py +112 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/__init__.py +3 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/_asymmetric.py +19 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/_cipheralgorithm.py +60 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/_serialization.py +168 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/__init__.py +3 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/dh.py +147 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/dsa.py +167 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ec.py +447 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ed25519.py +129 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ed448.py +131 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/padding.py +113 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/rsa.py +277 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/types.py +111 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/utils.py +24 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/x25519.py +122 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/x448.py +125 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/__init__.py +27 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/aead.py +23 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/algorithms.py +183 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/base.py +146 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/modes.py +268 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/cmac.py +10 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/constant_time.py +14 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/hashes.py +246 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/hmac.py +13 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/__init__.py +23 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/argon2.py +13 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/concatkdf.py +125 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/hkdf.py +101 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/kbkdf.py +305 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/pbkdf2.py +62 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/scrypt.py +19 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/x963kdf.py +61 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/keywrap.py +177 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/padding.py +69 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/poly1305.py +11 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/__init__.py +65 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/base.py +14 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/pkcs12.py +176 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/pkcs7.py +411 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/ssh.py +1619 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/twofactor/__init__.py +9 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/twofactor/hotp.py +101 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/twofactor/totp.py +56 -0
- package/python/lib/python3.12/site-packages/cryptography/py.typed +0 -0
- package/python/lib/python3.12/site-packages/cryptography/utils.py +139 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/__init__.py +270 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/base.py +848 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/certificate_transparency.py +35 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/extensions.py +2528 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/general_name.py +281 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/name.py +477 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/ocsp.py +379 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/oid.py +37 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/verification.py +34 -0
- package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/INSTALLER +1 -0
- package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/METADATA +139 -0
- package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/RECORD +106 -0
- package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/REQUESTED +0 -0
- package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/WHEEL +4 -0
- package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/licenses/LICENSE +3 -0
- package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/licenses/LICENSE.APACHE +202 -0
- package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/licenses/LICENSE.BSD +27 -0
- package/python/lib/python3.12/site-packages/pycparser/__init__.py +99 -0
- package/python/lib/python3.12/site-packages/pycparser/_ast_gen.py +355 -0
- package/python/lib/python3.12/site-packages/pycparser/_c_ast.cfg +195 -0
- package/python/lib/python3.12/site-packages/pycparser/ast_transforms.py +174 -0
- package/python/lib/python3.12/site-packages/pycparser/c_ast.py +1341 -0
- package/python/lib/python3.12/site-packages/pycparser/c_generator.py +573 -0
- package/python/lib/python3.12/site-packages/pycparser/c_lexer.py +706 -0
- package/python/lib/python3.12/site-packages/pycparser/c_parser.py +2376 -0
- package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/INSTALLER +1 -0
- package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/METADATA +244 -0
- package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/RECORD +14 -0
- package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/WHEEL +5 -0
- package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/licenses/LICENSE +27 -0
- package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
# This file is dual licensed under the terms of the Apache License, Version
|
|
2
|
+
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
|
3
|
+
# for complete details.
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
import abc
|
|
8
|
+
import ipaddress
|
|
9
|
+
import typing
|
|
10
|
+
from email.utils import parseaddr
|
|
11
|
+
|
|
12
|
+
from cryptography.x509.name import Name
|
|
13
|
+
from cryptography.x509.oid import ObjectIdentifier
|
|
14
|
+
|
|
15
|
+
_IPAddressTypes = typing.Union[
|
|
16
|
+
ipaddress.IPv4Address,
|
|
17
|
+
ipaddress.IPv6Address,
|
|
18
|
+
ipaddress.IPv4Network,
|
|
19
|
+
ipaddress.IPv6Network,
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class UnsupportedGeneralNameType(Exception):
|
|
24
|
+
pass
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class GeneralName(metaclass=abc.ABCMeta):
|
|
28
|
+
@property
|
|
29
|
+
@abc.abstractmethod
|
|
30
|
+
def value(self) -> typing.Any:
|
|
31
|
+
"""
|
|
32
|
+
Return the value of the object
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class RFC822Name(GeneralName):
|
|
37
|
+
def __init__(self, value: str) -> None:
|
|
38
|
+
if isinstance(value, str):
|
|
39
|
+
try:
|
|
40
|
+
value.encode("ascii")
|
|
41
|
+
except UnicodeEncodeError:
|
|
42
|
+
raise ValueError(
|
|
43
|
+
"RFC822Name values should be passed as an A-label string. "
|
|
44
|
+
"This means unicode characters should be encoded via "
|
|
45
|
+
"a library like idna."
|
|
46
|
+
)
|
|
47
|
+
else:
|
|
48
|
+
raise TypeError("value must be string")
|
|
49
|
+
|
|
50
|
+
name, address = parseaddr(value)
|
|
51
|
+
if name or not address:
|
|
52
|
+
# parseaddr has found a name (e.g. Name <email>) or the entire
|
|
53
|
+
# value is an empty string.
|
|
54
|
+
raise ValueError("Invalid rfc822name value")
|
|
55
|
+
|
|
56
|
+
self._value = value
|
|
57
|
+
|
|
58
|
+
@property
|
|
59
|
+
def value(self) -> str:
|
|
60
|
+
return self._value
|
|
61
|
+
|
|
62
|
+
@classmethod
|
|
63
|
+
def _init_without_validation(cls, value: str) -> RFC822Name:
|
|
64
|
+
instance = cls.__new__(cls)
|
|
65
|
+
instance._value = value
|
|
66
|
+
return instance
|
|
67
|
+
|
|
68
|
+
def __repr__(self) -> str:
|
|
69
|
+
return f"<RFC822Name(value={self.value!r})>"
|
|
70
|
+
|
|
71
|
+
def __eq__(self, other: object) -> bool:
|
|
72
|
+
if not isinstance(other, RFC822Name):
|
|
73
|
+
return NotImplemented
|
|
74
|
+
|
|
75
|
+
return self.value == other.value
|
|
76
|
+
|
|
77
|
+
def __hash__(self) -> int:
|
|
78
|
+
return hash(self.value)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class DNSName(GeneralName):
|
|
82
|
+
def __init__(self, value: str) -> None:
|
|
83
|
+
if isinstance(value, str):
|
|
84
|
+
try:
|
|
85
|
+
value.encode("ascii")
|
|
86
|
+
except UnicodeEncodeError:
|
|
87
|
+
raise ValueError(
|
|
88
|
+
"DNSName values should be passed as an A-label string. "
|
|
89
|
+
"This means unicode characters should be encoded via "
|
|
90
|
+
"a library like idna."
|
|
91
|
+
)
|
|
92
|
+
else:
|
|
93
|
+
raise TypeError("value must be string")
|
|
94
|
+
|
|
95
|
+
self._value = value
|
|
96
|
+
|
|
97
|
+
@property
|
|
98
|
+
def value(self) -> str:
|
|
99
|
+
return self._value
|
|
100
|
+
|
|
101
|
+
@classmethod
|
|
102
|
+
def _init_without_validation(cls, value: str) -> DNSName:
|
|
103
|
+
instance = cls.__new__(cls)
|
|
104
|
+
instance._value = value
|
|
105
|
+
return instance
|
|
106
|
+
|
|
107
|
+
def __repr__(self) -> str:
|
|
108
|
+
return f"<DNSName(value={self.value!r})>"
|
|
109
|
+
|
|
110
|
+
def __eq__(self, other: object) -> bool:
|
|
111
|
+
if not isinstance(other, DNSName):
|
|
112
|
+
return NotImplemented
|
|
113
|
+
|
|
114
|
+
return self.value == other.value
|
|
115
|
+
|
|
116
|
+
def __hash__(self) -> int:
|
|
117
|
+
return hash(self.value)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
class UniformResourceIdentifier(GeneralName):
|
|
121
|
+
def __init__(self, value: str) -> None:
|
|
122
|
+
if isinstance(value, str):
|
|
123
|
+
try:
|
|
124
|
+
value.encode("ascii")
|
|
125
|
+
except UnicodeEncodeError:
|
|
126
|
+
raise ValueError(
|
|
127
|
+
"URI values should be passed as an A-label string. "
|
|
128
|
+
"This means unicode characters should be encoded via "
|
|
129
|
+
"a library like idna."
|
|
130
|
+
)
|
|
131
|
+
else:
|
|
132
|
+
raise TypeError("value must be string")
|
|
133
|
+
|
|
134
|
+
self._value = value
|
|
135
|
+
|
|
136
|
+
@property
|
|
137
|
+
def value(self) -> str:
|
|
138
|
+
return self._value
|
|
139
|
+
|
|
140
|
+
@classmethod
|
|
141
|
+
def _init_without_validation(cls, value: str) -> UniformResourceIdentifier:
|
|
142
|
+
instance = cls.__new__(cls)
|
|
143
|
+
instance._value = value
|
|
144
|
+
return instance
|
|
145
|
+
|
|
146
|
+
def __repr__(self) -> str:
|
|
147
|
+
return f"<UniformResourceIdentifier(value={self.value!r})>"
|
|
148
|
+
|
|
149
|
+
def __eq__(self, other: object) -> bool:
|
|
150
|
+
if not isinstance(other, UniformResourceIdentifier):
|
|
151
|
+
return NotImplemented
|
|
152
|
+
|
|
153
|
+
return self.value == other.value
|
|
154
|
+
|
|
155
|
+
def __hash__(self) -> int:
|
|
156
|
+
return hash(self.value)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
class DirectoryName(GeneralName):
|
|
160
|
+
def __init__(self, value: Name) -> None:
|
|
161
|
+
if not isinstance(value, Name):
|
|
162
|
+
raise TypeError("value must be a Name")
|
|
163
|
+
|
|
164
|
+
self._value = value
|
|
165
|
+
|
|
166
|
+
@property
|
|
167
|
+
def value(self) -> Name:
|
|
168
|
+
return self._value
|
|
169
|
+
|
|
170
|
+
def __repr__(self) -> str:
|
|
171
|
+
return f"<DirectoryName(value={self.value})>"
|
|
172
|
+
|
|
173
|
+
def __eq__(self, other: object) -> bool:
|
|
174
|
+
if not isinstance(other, DirectoryName):
|
|
175
|
+
return NotImplemented
|
|
176
|
+
|
|
177
|
+
return self.value == other.value
|
|
178
|
+
|
|
179
|
+
def __hash__(self) -> int:
|
|
180
|
+
return hash(self.value)
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
class RegisteredID(GeneralName):
|
|
184
|
+
def __init__(self, value: ObjectIdentifier) -> None:
|
|
185
|
+
if not isinstance(value, ObjectIdentifier):
|
|
186
|
+
raise TypeError("value must be an ObjectIdentifier")
|
|
187
|
+
|
|
188
|
+
self._value = value
|
|
189
|
+
|
|
190
|
+
@property
|
|
191
|
+
def value(self) -> ObjectIdentifier:
|
|
192
|
+
return self._value
|
|
193
|
+
|
|
194
|
+
def __repr__(self) -> str:
|
|
195
|
+
return f"<RegisteredID(value={self.value})>"
|
|
196
|
+
|
|
197
|
+
def __eq__(self, other: object) -> bool:
|
|
198
|
+
if not isinstance(other, RegisteredID):
|
|
199
|
+
return NotImplemented
|
|
200
|
+
|
|
201
|
+
return self.value == other.value
|
|
202
|
+
|
|
203
|
+
def __hash__(self) -> int:
|
|
204
|
+
return hash(self.value)
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
class IPAddress(GeneralName):
|
|
208
|
+
def __init__(self, value: _IPAddressTypes) -> None:
|
|
209
|
+
if not isinstance(
|
|
210
|
+
value,
|
|
211
|
+
(
|
|
212
|
+
ipaddress.IPv4Address,
|
|
213
|
+
ipaddress.IPv6Address,
|
|
214
|
+
ipaddress.IPv4Network,
|
|
215
|
+
ipaddress.IPv6Network,
|
|
216
|
+
),
|
|
217
|
+
):
|
|
218
|
+
raise TypeError(
|
|
219
|
+
"value must be an instance of ipaddress.IPv4Address, "
|
|
220
|
+
"ipaddress.IPv6Address, ipaddress.IPv4Network, or "
|
|
221
|
+
"ipaddress.IPv6Network"
|
|
222
|
+
)
|
|
223
|
+
|
|
224
|
+
self._value = value
|
|
225
|
+
|
|
226
|
+
@property
|
|
227
|
+
def value(self) -> _IPAddressTypes:
|
|
228
|
+
return self._value
|
|
229
|
+
|
|
230
|
+
def _packed(self) -> bytes:
|
|
231
|
+
if isinstance(
|
|
232
|
+
self.value, (ipaddress.IPv4Address, ipaddress.IPv6Address)
|
|
233
|
+
):
|
|
234
|
+
return self.value.packed
|
|
235
|
+
else:
|
|
236
|
+
return (
|
|
237
|
+
self.value.network_address.packed + self.value.netmask.packed
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
def __repr__(self) -> str:
|
|
241
|
+
return f"<IPAddress(value={self.value})>"
|
|
242
|
+
|
|
243
|
+
def __eq__(self, other: object) -> bool:
|
|
244
|
+
if not isinstance(other, IPAddress):
|
|
245
|
+
return NotImplemented
|
|
246
|
+
|
|
247
|
+
return self.value == other.value
|
|
248
|
+
|
|
249
|
+
def __hash__(self) -> int:
|
|
250
|
+
return hash(self.value)
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
class OtherName(GeneralName):
|
|
254
|
+
def __init__(self, type_id: ObjectIdentifier, value: bytes) -> None:
|
|
255
|
+
if not isinstance(type_id, ObjectIdentifier):
|
|
256
|
+
raise TypeError("type_id must be an ObjectIdentifier")
|
|
257
|
+
if not isinstance(value, bytes):
|
|
258
|
+
raise TypeError("value must be a binary string")
|
|
259
|
+
|
|
260
|
+
self._type_id = type_id
|
|
261
|
+
self._value = value
|
|
262
|
+
|
|
263
|
+
@property
|
|
264
|
+
def type_id(self) -> ObjectIdentifier:
|
|
265
|
+
return self._type_id
|
|
266
|
+
|
|
267
|
+
@property
|
|
268
|
+
def value(self) -> bytes:
|
|
269
|
+
return self._value
|
|
270
|
+
|
|
271
|
+
def __repr__(self) -> str:
|
|
272
|
+
return f"<OtherName(type_id={self.type_id}, value={self.value!r})>"
|
|
273
|
+
|
|
274
|
+
def __eq__(self, other: object) -> bool:
|
|
275
|
+
if not isinstance(other, OtherName):
|
|
276
|
+
return NotImplemented
|
|
277
|
+
|
|
278
|
+
return self.type_id == other.type_id and self.value == other.value
|
|
279
|
+
|
|
280
|
+
def __hash__(self) -> int:
|
|
281
|
+
return hash((self.type_id, self.value))
|