@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.
Files changed (159) hide show
  1. package/README.md +1 -1
  2. package/bin/pairling-connectd +0 -0
  3. package/manifest.json +4 -4
  4. package/package.json +3 -3
  5. package/python/bin/python3 +0 -0
  6. package/python/bin/python3.12 +0 -0
  7. package/python/lib/libpython3.12.dylib +0 -0
  8. package/python/lib/python3.12/lib-dynload/_crypt.cpython-312-darwin.so +0 -0
  9. package/python/lib/python3.12/lib-dynload/_dbm.cpython-312-darwin.so +0 -0
  10. package/python/lib/python3.12/site-packages/_cffi_backend.cpython-312-darwin.so +0 -0
  11. package/python/lib/python3.12/site-packages/cffi/__init__.py +14 -0
  12. package/python/lib/python3.12/site-packages/cffi/_cffi_errors.h +149 -0
  13. package/python/lib/python3.12/site-packages/cffi/_cffi_include.h +389 -0
  14. package/python/lib/python3.12/site-packages/cffi/_embedding.h +550 -0
  15. package/python/lib/python3.12/site-packages/cffi/_imp_emulation.py +83 -0
  16. package/python/lib/python3.12/site-packages/cffi/_shimmed_dist_utils.py +45 -0
  17. package/python/lib/python3.12/site-packages/cffi/api.py +967 -0
  18. package/python/lib/python3.12/site-packages/cffi/backend_ctypes.py +1121 -0
  19. package/python/lib/python3.12/site-packages/cffi/cffi_opcode.py +187 -0
  20. package/python/lib/python3.12/site-packages/cffi/commontypes.py +82 -0
  21. package/python/lib/python3.12/site-packages/cffi/cparser.py +1015 -0
  22. package/python/lib/python3.12/site-packages/cffi/error.py +31 -0
  23. package/python/lib/python3.12/site-packages/cffi/ffiplatform.py +113 -0
  24. package/python/lib/python3.12/site-packages/cffi/lock.py +30 -0
  25. package/python/lib/python3.12/site-packages/cffi/model.py +618 -0
  26. package/python/lib/python3.12/site-packages/cffi/parse_c_type.h +181 -0
  27. package/python/lib/python3.12/site-packages/cffi/pkgconfig.py +121 -0
  28. package/python/lib/python3.12/site-packages/cffi/recompiler.py +1598 -0
  29. package/python/lib/python3.12/site-packages/cffi/setuptools_ext.py +216 -0
  30. package/python/lib/python3.12/site-packages/cffi/vengine_cpy.py +1084 -0
  31. package/python/lib/python3.12/site-packages/cffi/vengine_gen.py +679 -0
  32. package/python/lib/python3.12/site-packages/cffi/verifier.py +306 -0
  33. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/INSTALLER +1 -0
  34. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/LICENSE +26 -0
  35. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/METADATA +40 -0
  36. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/RECORD +30 -0
  37. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/WHEEL +5 -0
  38. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/entry_points.txt +2 -0
  39. package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/top_level.txt +2 -0
  40. package/python/lib/python3.12/site-packages/cryptography/__about__.py +17 -0
  41. package/python/lib/python3.12/site-packages/cryptography/__init__.py +26 -0
  42. package/python/lib/python3.12/site-packages/cryptography/exceptions.py +52 -0
  43. package/python/lib/python3.12/site-packages/cryptography/fernet.py +224 -0
  44. package/python/lib/python3.12/site-packages/cryptography/hazmat/__init__.py +13 -0
  45. package/python/lib/python3.12/site-packages/cryptography/hazmat/_oid.py +348 -0
  46. package/python/lib/python3.12/site-packages/cryptography/hazmat/backends/__init__.py +13 -0
  47. package/python/lib/python3.12/site-packages/cryptography/hazmat/backends/openssl/__init__.py +9 -0
  48. package/python/lib/python3.12/site-packages/cryptography/hazmat/backends/openssl/backend.py +308 -0
  49. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/__init__.py +3 -0
  50. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/__init__.pyi +37 -0
  51. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/_openssl.pyi +8 -0
  52. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/asn1.pyi +7 -0
  53. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/exceptions.pyi +17 -0
  54. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/ocsp.pyi +117 -0
  55. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/__init__.pyi +75 -0
  56. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/aead.pyi +107 -0
  57. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ciphers.pyi +38 -0
  58. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/cmac.pyi +18 -0
  59. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/dh.pyi +51 -0
  60. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/dsa.pyi +41 -0
  61. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ec.pyi +52 -0
  62. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ed25519.pyi +13 -0
  63. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ed448.pyi +13 -0
  64. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/hashes.pyi +28 -0
  65. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/hmac.pyi +22 -0
  66. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/kdf.pyi +49 -0
  67. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/keys.pyi +34 -0
  68. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/poly1305.pyi +15 -0
  69. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/rsa.pyi +55 -0
  70. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/x25519.pyi +13 -0
  71. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/x448.pyi +13 -0
  72. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/pkcs12.pyi +52 -0
  73. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/pkcs7.pyi +50 -0
  74. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/test_support.pyi +23 -0
  75. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/x509.pyi +313 -0
  76. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust.abi3.so +0 -0
  77. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/__init__.py +3 -0
  78. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/_conditional.py +191 -0
  79. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/binding.py +122 -0
  80. package/python/lib/python3.12/site-packages/cryptography/hazmat/decrepit/__init__.py +5 -0
  81. package/python/lib/python3.12/site-packages/cryptography/hazmat/decrepit/ciphers/__init__.py +5 -0
  82. package/python/lib/python3.12/site-packages/cryptography/hazmat/decrepit/ciphers/algorithms.py +112 -0
  83. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/__init__.py +3 -0
  84. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/_asymmetric.py +19 -0
  85. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/_cipheralgorithm.py +60 -0
  86. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/_serialization.py +168 -0
  87. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/__init__.py +3 -0
  88. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/dh.py +147 -0
  89. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/dsa.py +167 -0
  90. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ec.py +447 -0
  91. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ed25519.py +129 -0
  92. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ed448.py +131 -0
  93. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/padding.py +113 -0
  94. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/rsa.py +277 -0
  95. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/types.py +111 -0
  96. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/utils.py +24 -0
  97. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/x25519.py +122 -0
  98. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/x448.py +125 -0
  99. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/__init__.py +27 -0
  100. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/aead.py +23 -0
  101. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/algorithms.py +183 -0
  102. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/base.py +146 -0
  103. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/modes.py +268 -0
  104. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/cmac.py +10 -0
  105. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/constant_time.py +14 -0
  106. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/hashes.py +246 -0
  107. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/hmac.py +13 -0
  108. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/__init__.py +23 -0
  109. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/argon2.py +13 -0
  110. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/concatkdf.py +125 -0
  111. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/hkdf.py +101 -0
  112. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/kbkdf.py +305 -0
  113. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/pbkdf2.py +62 -0
  114. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/scrypt.py +19 -0
  115. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/x963kdf.py +61 -0
  116. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/keywrap.py +177 -0
  117. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/padding.py +69 -0
  118. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/poly1305.py +11 -0
  119. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/__init__.py +65 -0
  120. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/base.py +14 -0
  121. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/pkcs12.py +176 -0
  122. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/pkcs7.py +411 -0
  123. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/ssh.py +1619 -0
  124. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/twofactor/__init__.py +9 -0
  125. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/twofactor/hotp.py +101 -0
  126. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/twofactor/totp.py +56 -0
  127. package/python/lib/python3.12/site-packages/cryptography/py.typed +0 -0
  128. package/python/lib/python3.12/site-packages/cryptography/utils.py +139 -0
  129. package/python/lib/python3.12/site-packages/cryptography/x509/__init__.py +270 -0
  130. package/python/lib/python3.12/site-packages/cryptography/x509/base.py +848 -0
  131. package/python/lib/python3.12/site-packages/cryptography/x509/certificate_transparency.py +35 -0
  132. package/python/lib/python3.12/site-packages/cryptography/x509/extensions.py +2528 -0
  133. package/python/lib/python3.12/site-packages/cryptography/x509/general_name.py +281 -0
  134. package/python/lib/python3.12/site-packages/cryptography/x509/name.py +477 -0
  135. package/python/lib/python3.12/site-packages/cryptography/x509/ocsp.py +379 -0
  136. package/python/lib/python3.12/site-packages/cryptography/x509/oid.py +37 -0
  137. package/python/lib/python3.12/site-packages/cryptography/x509/verification.py +34 -0
  138. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/INSTALLER +1 -0
  139. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/METADATA +139 -0
  140. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/RECORD +106 -0
  141. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/REQUESTED +0 -0
  142. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/WHEEL +4 -0
  143. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/licenses/LICENSE +3 -0
  144. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/licenses/LICENSE.APACHE +202 -0
  145. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/licenses/LICENSE.BSD +27 -0
  146. package/python/lib/python3.12/site-packages/pycparser/__init__.py +99 -0
  147. package/python/lib/python3.12/site-packages/pycparser/_ast_gen.py +355 -0
  148. package/python/lib/python3.12/site-packages/pycparser/_c_ast.cfg +195 -0
  149. package/python/lib/python3.12/site-packages/pycparser/ast_transforms.py +174 -0
  150. package/python/lib/python3.12/site-packages/pycparser/c_ast.py +1341 -0
  151. package/python/lib/python3.12/site-packages/pycparser/c_generator.py +573 -0
  152. package/python/lib/python3.12/site-packages/pycparser/c_lexer.py +706 -0
  153. package/python/lib/python3.12/site-packages/pycparser/c_parser.py +2376 -0
  154. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/INSTALLER +1 -0
  155. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/METADATA +244 -0
  156. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/RECORD +14 -0
  157. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/WHEEL +5 -0
  158. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/licenses/LICENSE +27 -0
  159. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,313 @@
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
+ import datetime
6
+ import typing
7
+ from collections.abc import Iterator
8
+
9
+ from cryptography import x509
10
+ from cryptography.hazmat.primitives import hashes, serialization
11
+ from cryptography.hazmat.primitives.asymmetric.ec import ECDSA
12
+ from cryptography.hazmat.primitives.asymmetric.padding import PSS, PKCS1v15
13
+ from cryptography.hazmat.primitives.asymmetric.types import (
14
+ CertificateIssuerPublicKeyTypes,
15
+ CertificatePublicKeyTypes,
16
+ PrivateKeyTypes,
17
+ )
18
+ from cryptography.x509 import certificate_transparency
19
+
20
+ def load_pem_x509_certificate(
21
+ data: bytes, backend: typing.Any = None
22
+ ) -> x509.Certificate: ...
23
+ def load_der_x509_certificate(
24
+ data: bytes, backend: typing.Any = None
25
+ ) -> x509.Certificate: ...
26
+ def load_pem_x509_certificates(
27
+ data: bytes,
28
+ ) -> list[x509.Certificate]: ...
29
+ def load_pem_x509_crl(
30
+ data: bytes, backend: typing.Any = None
31
+ ) -> x509.CertificateRevocationList: ...
32
+ def load_der_x509_crl(
33
+ data: bytes, backend: typing.Any = None
34
+ ) -> x509.CertificateRevocationList: ...
35
+ def load_pem_x509_csr(
36
+ data: bytes, backend: typing.Any = None
37
+ ) -> x509.CertificateSigningRequest: ...
38
+ def load_der_x509_csr(
39
+ data: bytes, backend: typing.Any = None
40
+ ) -> x509.CertificateSigningRequest: ...
41
+ def encode_name_bytes(name: x509.Name) -> bytes: ...
42
+ def encode_extension_value(extension: x509.ExtensionType) -> bytes: ...
43
+ def create_x509_certificate(
44
+ builder: x509.CertificateBuilder,
45
+ private_key: PrivateKeyTypes,
46
+ hash_algorithm: hashes.HashAlgorithm | None,
47
+ rsa_padding: PKCS1v15 | PSS | None,
48
+ ecdsa_deterministic: bool | None,
49
+ ) -> x509.Certificate: ...
50
+ def create_x509_csr(
51
+ builder: x509.CertificateSigningRequestBuilder,
52
+ private_key: PrivateKeyTypes,
53
+ hash_algorithm: hashes.HashAlgorithm | None,
54
+ rsa_padding: PKCS1v15 | PSS | None,
55
+ ecdsa_deterministic: bool | None,
56
+ ) -> x509.CertificateSigningRequest: ...
57
+ def create_x509_crl(
58
+ builder: x509.CertificateRevocationListBuilder,
59
+ private_key: PrivateKeyTypes,
60
+ hash_algorithm: hashes.HashAlgorithm | None,
61
+ rsa_padding: PKCS1v15 | PSS | None,
62
+ ecdsa_deterministic: bool | None,
63
+ ) -> x509.CertificateRevocationList: ...
64
+
65
+ class Sct:
66
+ @property
67
+ def version(self) -> certificate_transparency.Version: ...
68
+ @property
69
+ def log_id(self) -> bytes: ...
70
+ @property
71
+ def timestamp(self) -> datetime.datetime: ...
72
+ @property
73
+ def entry_type(self) -> certificate_transparency.LogEntryType: ...
74
+ @property
75
+ def signature_hash_algorithm(self) -> hashes.HashAlgorithm: ...
76
+ @property
77
+ def signature_algorithm(
78
+ self,
79
+ ) -> certificate_transparency.SignatureAlgorithm: ...
80
+ @property
81
+ def signature(self) -> bytes: ...
82
+ @property
83
+ def extension_bytes(self) -> bytes: ...
84
+
85
+ class Certificate:
86
+ def fingerprint(self, algorithm: hashes.HashAlgorithm) -> bytes: ...
87
+ @property
88
+ def serial_number(self) -> int: ...
89
+ @property
90
+ def version(self) -> x509.Version: ...
91
+ def public_key(self) -> CertificatePublicKeyTypes: ...
92
+ @property
93
+ def public_key_algorithm_oid(self) -> x509.ObjectIdentifier: ...
94
+ @property
95
+ def not_valid_before(self) -> datetime.datetime: ...
96
+ @property
97
+ def not_valid_before_utc(self) -> datetime.datetime: ...
98
+ @property
99
+ def not_valid_after(self) -> datetime.datetime: ...
100
+ @property
101
+ def not_valid_after_utc(self) -> datetime.datetime: ...
102
+ @property
103
+ def issuer(self) -> x509.Name: ...
104
+ @property
105
+ def subject(self) -> x509.Name: ...
106
+ @property
107
+ def signature_hash_algorithm(
108
+ self,
109
+ ) -> hashes.HashAlgorithm | None: ...
110
+ @property
111
+ def signature_algorithm_oid(self) -> x509.ObjectIdentifier: ...
112
+ @property
113
+ def signature_algorithm_parameters(
114
+ self,
115
+ ) -> PSS | PKCS1v15 | ECDSA | None: ...
116
+ @property
117
+ def extensions(self) -> x509.Extensions: ...
118
+ @property
119
+ def signature(self) -> bytes: ...
120
+ @property
121
+ def tbs_certificate_bytes(self) -> bytes: ...
122
+ @property
123
+ def tbs_precertificate_bytes(self) -> bytes: ...
124
+ def __eq__(self, other: object) -> bool: ...
125
+ def __hash__(self) -> int: ...
126
+ def public_bytes(self, encoding: serialization.Encoding) -> bytes: ...
127
+ def verify_directly_issued_by(self, issuer: Certificate) -> None: ...
128
+
129
+ class RevokedCertificate: ...
130
+
131
+ class CertificateRevocationList:
132
+ def public_bytes(self, encoding: serialization.Encoding) -> bytes: ...
133
+ def fingerprint(self, algorithm: hashes.HashAlgorithm) -> bytes: ...
134
+ def get_revoked_certificate_by_serial_number(
135
+ self, serial_number: int
136
+ ) -> x509.RevokedCertificate | None: ...
137
+ @property
138
+ def signature_hash_algorithm(
139
+ self,
140
+ ) -> hashes.HashAlgorithm | None: ...
141
+ @property
142
+ def signature_algorithm_oid(self) -> x509.ObjectIdentifier: ...
143
+ @property
144
+ def signature_algorithm_parameters(
145
+ self,
146
+ ) -> PSS | PKCS1v15 | ECDSA | None: ...
147
+ @property
148
+ def issuer(self) -> x509.Name: ...
149
+ @property
150
+ def next_update(self) -> datetime.datetime | None: ...
151
+ @property
152
+ def next_update_utc(self) -> datetime.datetime | None: ...
153
+ @property
154
+ def last_update(self) -> datetime.datetime: ...
155
+ @property
156
+ def last_update_utc(self) -> datetime.datetime: ...
157
+ @property
158
+ def extensions(self) -> x509.Extensions: ...
159
+ @property
160
+ def signature(self) -> bytes: ...
161
+ @property
162
+ def tbs_certlist_bytes(self) -> bytes: ...
163
+ def __eq__(self, other: object) -> bool: ...
164
+ def __len__(self) -> int: ...
165
+ @typing.overload
166
+ def __getitem__(self, idx: int) -> x509.RevokedCertificate: ...
167
+ @typing.overload
168
+ def __getitem__(self, idx: slice) -> list[x509.RevokedCertificate]: ...
169
+ def __iter__(self) -> Iterator[x509.RevokedCertificate]: ...
170
+ def is_signature_valid(
171
+ self, public_key: CertificateIssuerPublicKeyTypes
172
+ ) -> bool: ...
173
+
174
+ class CertificateSigningRequest:
175
+ def __eq__(self, other: object) -> bool: ...
176
+ def __hash__(self) -> int: ...
177
+ def public_key(self) -> CertificatePublicKeyTypes: ...
178
+ @property
179
+ def subject(self) -> x509.Name: ...
180
+ @property
181
+ def signature_hash_algorithm(
182
+ self,
183
+ ) -> hashes.HashAlgorithm | None: ...
184
+ @property
185
+ def signature_algorithm_oid(self) -> x509.ObjectIdentifier: ...
186
+ @property
187
+ def signature_algorithm_parameters(
188
+ self,
189
+ ) -> PSS | PKCS1v15 | ECDSA | None: ...
190
+ @property
191
+ def extensions(self) -> x509.Extensions: ...
192
+ @property
193
+ def attributes(self) -> x509.Attributes: ...
194
+ def public_bytes(self, encoding: serialization.Encoding) -> bytes: ...
195
+ @property
196
+ def signature(self) -> bytes: ...
197
+ @property
198
+ def tbs_certrequest_bytes(self) -> bytes: ...
199
+ @property
200
+ def is_signature_valid(self) -> bool: ...
201
+ def get_attribute_for_oid(self, oid: x509.ObjectIdentifier) -> bytes: ...
202
+
203
+ class PolicyBuilder:
204
+ def time(self, time: datetime.datetime) -> PolicyBuilder: ...
205
+ def store(self, store: Store) -> PolicyBuilder: ...
206
+ def max_chain_depth(self, max_chain_depth: int) -> PolicyBuilder: ...
207
+ def extension_policies(
208
+ self, *, ca_policy: ExtensionPolicy, ee_policy: ExtensionPolicy
209
+ ) -> PolicyBuilder: ...
210
+ def build_client_verifier(self) -> ClientVerifier: ...
211
+ def build_server_verifier(
212
+ self, subject: x509.verification.Subject
213
+ ) -> ServerVerifier: ...
214
+
215
+ class Policy:
216
+ @property
217
+ def max_chain_depth(self) -> int: ...
218
+ @property
219
+ def subject(self) -> x509.verification.Subject | None: ...
220
+ @property
221
+ def validation_time(self) -> datetime.datetime: ...
222
+ @property
223
+ def extended_key_usage(self) -> x509.ObjectIdentifier: ...
224
+ @property
225
+ def minimum_rsa_modulus(self) -> int: ...
226
+
227
+ class Criticality:
228
+ CRITICAL: Criticality
229
+ AGNOSTIC: Criticality
230
+ NON_CRITICAL: Criticality
231
+
232
+ T = typing.TypeVar("T", contravariant=True, bound=x509.ExtensionType)
233
+
234
+ MaybeExtensionValidatorCallback = typing.Callable[
235
+ [
236
+ Policy,
237
+ x509.Certificate,
238
+ T | None,
239
+ ],
240
+ None,
241
+ ]
242
+
243
+ PresentExtensionValidatorCallback = typing.Callable[
244
+ [Policy, x509.Certificate, T],
245
+ None,
246
+ ]
247
+
248
+ class ExtensionPolicy:
249
+ @staticmethod
250
+ def permit_all() -> ExtensionPolicy: ...
251
+ @staticmethod
252
+ def webpki_defaults_ca() -> ExtensionPolicy: ...
253
+ @staticmethod
254
+ def webpki_defaults_ee() -> ExtensionPolicy: ...
255
+ def require_not_present(
256
+ self, extension_type: type[x509.ExtensionType]
257
+ ) -> ExtensionPolicy: ...
258
+ def may_be_present(
259
+ self,
260
+ extension_type: type[T],
261
+ criticality: Criticality,
262
+ validator: MaybeExtensionValidatorCallback[T] | None,
263
+ ) -> ExtensionPolicy: ...
264
+ def require_present(
265
+ self,
266
+ extension_type: type[T],
267
+ criticality: Criticality,
268
+ validator: PresentExtensionValidatorCallback[T] | None,
269
+ ) -> ExtensionPolicy: ...
270
+
271
+ class VerifiedClient:
272
+ @property
273
+ def subjects(self) -> list[x509.GeneralName] | None: ...
274
+ @property
275
+ def chain(self) -> list[x509.Certificate]: ...
276
+
277
+ class ClientVerifier:
278
+ @property
279
+ def policy(self) -> Policy: ...
280
+ @property
281
+ def validation_time(self) -> datetime.datetime: ...
282
+ @property
283
+ def max_chain_depth(self) -> int: ...
284
+ @property
285
+ def store(self) -> Store: ...
286
+ def verify(
287
+ self,
288
+ leaf: x509.Certificate,
289
+ intermediates: list[x509.Certificate],
290
+ ) -> VerifiedClient: ...
291
+
292
+ class ServerVerifier:
293
+ @property
294
+ def policy(self) -> Policy: ...
295
+ @property
296
+ def subject(self) -> x509.verification.Subject: ...
297
+ @property
298
+ def validation_time(self) -> datetime.datetime: ...
299
+ @property
300
+ def max_chain_depth(self) -> int: ...
301
+ @property
302
+ def store(self) -> Store: ...
303
+ def verify(
304
+ self,
305
+ leaf: x509.Certificate,
306
+ intermediates: list[x509.Certificate],
307
+ ) -> list[x509.Certificate]: ...
308
+
309
+ class Store:
310
+ def __init__(self, certs: list[x509.Certificate]) -> None: ...
311
+
312
+ class VerificationError(Exception):
313
+ pass
@@ -0,0 +1,3 @@
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.
@@ -0,0 +1,191 @@
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
+
8
+ def cryptography_has_set_cert_cb() -> list[str]:
9
+ return [
10
+ "SSL_CTX_set_cert_cb",
11
+ "SSL_set_cert_cb",
12
+ ]
13
+
14
+
15
+ def cryptography_has_ssl_st() -> list[str]:
16
+ return [
17
+ "SSL_ST_BEFORE",
18
+ "SSL_ST_OK",
19
+ "SSL_ST_INIT",
20
+ "SSL_ST_RENEGOTIATE",
21
+ ]
22
+
23
+
24
+ def cryptography_has_tls_st() -> list[str]:
25
+ return [
26
+ "TLS_ST_BEFORE",
27
+ "TLS_ST_OK",
28
+ ]
29
+
30
+
31
+ def cryptography_has_ssl_sigalgs() -> list[str]:
32
+ return [
33
+ "SSL_CTX_set1_sigalgs_list",
34
+ ]
35
+
36
+
37
+ def cryptography_has_psk() -> list[str]:
38
+ return [
39
+ "SSL_CTX_use_psk_identity_hint",
40
+ "SSL_CTX_set_psk_server_callback",
41
+ "SSL_CTX_set_psk_client_callback",
42
+ ]
43
+
44
+
45
+ def cryptography_has_psk_tlsv13() -> list[str]:
46
+ return [
47
+ "SSL_CTX_set_psk_find_session_callback",
48
+ "SSL_CTX_set_psk_use_session_callback",
49
+ "Cryptography_SSL_SESSION_new",
50
+ "SSL_CIPHER_find",
51
+ "SSL_SESSION_set1_master_key",
52
+ "SSL_SESSION_set_cipher",
53
+ "SSL_SESSION_set_protocol_version",
54
+ ]
55
+
56
+
57
+ def cryptography_has_custom_ext() -> list[str]:
58
+ return [
59
+ "SSL_CTX_add_client_custom_ext",
60
+ "SSL_CTX_add_server_custom_ext",
61
+ "SSL_extension_supported",
62
+ ]
63
+
64
+
65
+ def cryptography_has_tlsv13_functions() -> list[str]:
66
+ return [
67
+ "SSL_CTX_set_ciphersuites",
68
+ ]
69
+
70
+
71
+ def cryptography_has_tlsv13_hs_functions() -> list[str]:
72
+ return [
73
+ "SSL_VERIFY_POST_HANDSHAKE",
74
+ "SSL_verify_client_post_handshake",
75
+ "SSL_CTX_set_post_handshake_auth",
76
+ "SSL_set_post_handshake_auth",
77
+ "SSL_SESSION_get_max_early_data",
78
+ "SSL_write_early_data",
79
+ "SSL_read_early_data",
80
+ "SSL_CTX_set_max_early_data",
81
+ ]
82
+
83
+
84
+ def cryptography_has_engine() -> list[str]:
85
+ return [
86
+ "ENGINE_by_id",
87
+ "ENGINE_init",
88
+ "ENGINE_finish",
89
+ "ENGINE_get_default_RAND",
90
+ "ENGINE_set_default_RAND",
91
+ "ENGINE_unregister_RAND",
92
+ "ENGINE_ctrl_cmd",
93
+ "ENGINE_free",
94
+ "ENGINE_get_name",
95
+ "ENGINE_ctrl_cmd_string",
96
+ "ENGINE_load_builtin_engines",
97
+ "ENGINE_load_private_key",
98
+ "ENGINE_load_public_key",
99
+ "SSL_CTX_set_client_cert_engine",
100
+ ]
101
+
102
+
103
+ def cryptography_has_verified_chain() -> list[str]:
104
+ return [
105
+ "SSL_get0_verified_chain",
106
+ ]
107
+
108
+
109
+ def cryptography_has_srtp() -> list[str]:
110
+ return [
111
+ "SSL_CTX_set_tlsext_use_srtp",
112
+ "SSL_set_tlsext_use_srtp",
113
+ "SSL_get_selected_srtp_profile",
114
+ ]
115
+
116
+
117
+ def cryptography_has_op_no_renegotiation() -> list[str]:
118
+ return [
119
+ "SSL_OP_NO_RENEGOTIATION",
120
+ ]
121
+
122
+
123
+ def cryptography_has_dtls_get_data_mtu() -> list[str]:
124
+ return [
125
+ "DTLS_get_data_mtu",
126
+ ]
127
+
128
+
129
+ def cryptography_has_ssl_cookie() -> list[str]:
130
+ return [
131
+ "SSL_OP_COOKIE_EXCHANGE",
132
+ "DTLSv1_listen",
133
+ "SSL_CTX_set_cookie_generate_cb",
134
+ "SSL_CTX_set_cookie_verify_cb",
135
+ ]
136
+
137
+
138
+ def cryptography_has_prime_checks() -> list[str]:
139
+ return [
140
+ "BN_prime_checks_for_size",
141
+ ]
142
+
143
+
144
+ def cryptography_has_unexpected_eof_while_reading() -> list[str]:
145
+ return ["SSL_R_UNEXPECTED_EOF_WHILE_READING"]
146
+
147
+
148
+ def cryptography_has_ssl_op_ignore_unexpected_eof() -> list[str]:
149
+ return [
150
+ "SSL_OP_IGNORE_UNEXPECTED_EOF",
151
+ ]
152
+
153
+
154
+ def cryptography_has_get_extms_support() -> list[str]:
155
+ return ["SSL_get_extms_support"]
156
+
157
+
158
+ # This is a mapping of
159
+ # {condition: function-returning-names-dependent-on-that-condition} so we can
160
+ # loop over them and delete unsupported names at runtime. It will be removed
161
+ # when cffi supports #if in cdef. We use functions instead of just a dict of
162
+ # lists so we can use coverage to measure which are used.
163
+ CONDITIONAL_NAMES = {
164
+ "Cryptography_HAS_SET_CERT_CB": cryptography_has_set_cert_cb,
165
+ "Cryptography_HAS_SSL_ST": cryptography_has_ssl_st,
166
+ "Cryptography_HAS_TLS_ST": cryptography_has_tls_st,
167
+ "Cryptography_HAS_SIGALGS": cryptography_has_ssl_sigalgs,
168
+ "Cryptography_HAS_PSK": cryptography_has_psk,
169
+ "Cryptography_HAS_PSK_TLSv1_3": cryptography_has_psk_tlsv13,
170
+ "Cryptography_HAS_CUSTOM_EXT": cryptography_has_custom_ext,
171
+ "Cryptography_HAS_TLSv1_3_FUNCTIONS": cryptography_has_tlsv13_functions,
172
+ "Cryptography_HAS_TLSv1_3_HS_FUNCTIONS": (
173
+ cryptography_has_tlsv13_hs_functions
174
+ ),
175
+ "Cryptography_HAS_ENGINE": cryptography_has_engine,
176
+ "Cryptography_HAS_VERIFIED_CHAIN": cryptography_has_verified_chain,
177
+ "Cryptography_HAS_SRTP": cryptography_has_srtp,
178
+ "Cryptography_HAS_OP_NO_RENEGOTIATION": (
179
+ cryptography_has_op_no_renegotiation
180
+ ),
181
+ "Cryptography_HAS_DTLS_GET_DATA_MTU": cryptography_has_dtls_get_data_mtu,
182
+ "Cryptography_HAS_SSL_COOKIE": cryptography_has_ssl_cookie,
183
+ "Cryptography_HAS_PRIME_CHECKS": cryptography_has_prime_checks,
184
+ "Cryptography_HAS_UNEXPECTED_EOF_WHILE_READING": (
185
+ cryptography_has_unexpected_eof_while_reading
186
+ ),
187
+ "Cryptography_HAS_SSL_OP_IGNORE_UNEXPECTED_EOF": (
188
+ cryptography_has_ssl_op_ignore_unexpected_eof
189
+ ),
190
+ "Cryptography_HAS_GET_EXTMS_SUPPORT": cryptography_has_get_extms_support,
191
+ }
@@ -0,0 +1,122 @@
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 os
8
+ import sys
9
+ import threading
10
+ import types
11
+ import typing
12
+ import warnings
13
+ from collections.abc import Callable
14
+
15
+ import cryptography
16
+ from cryptography.exceptions import InternalError
17
+ from cryptography.hazmat.bindings._rust import _openssl, openssl
18
+ from cryptography.hazmat.bindings.openssl._conditional import CONDITIONAL_NAMES
19
+
20
+
21
+ def _openssl_assert(ok: bool) -> None:
22
+ if not ok:
23
+ errors = openssl.capture_error_stack()
24
+
25
+ raise InternalError(
26
+ "Unknown OpenSSL error. This error is commonly encountered when "
27
+ "another library is not cleaning up the OpenSSL error stack. If "
28
+ "you are using cryptography with another library that uses "
29
+ "OpenSSL try disabling it before reporting a bug. Otherwise "
30
+ "please file an issue at https://github.com/pyca/cryptography/"
31
+ "issues with information on how to reproduce "
32
+ f"this. ({errors!r})",
33
+ errors,
34
+ )
35
+
36
+
37
+ def build_conditional_library(
38
+ lib: typing.Any,
39
+ conditional_names: dict[str, Callable[[], list[str]]],
40
+ ) -> typing.Any:
41
+ conditional_lib = types.ModuleType("lib")
42
+ conditional_lib._original_lib = lib # type: ignore[attr-defined]
43
+ excluded_names = set()
44
+ for condition, names_cb in conditional_names.items():
45
+ if not getattr(lib, condition):
46
+ excluded_names.update(names_cb())
47
+
48
+ for attr in dir(lib):
49
+ if attr not in excluded_names:
50
+ setattr(conditional_lib, attr, getattr(lib, attr))
51
+
52
+ return conditional_lib
53
+
54
+
55
+ class Binding:
56
+ """
57
+ OpenSSL API wrapper.
58
+ """
59
+
60
+ lib: typing.ClassVar = None
61
+ ffi = _openssl.ffi
62
+ _lib_loaded = False
63
+ _init_lock = threading.Lock()
64
+
65
+ def __init__(self) -> None:
66
+ self._ensure_ffi_initialized()
67
+
68
+ @classmethod
69
+ def _ensure_ffi_initialized(cls) -> None:
70
+ with cls._init_lock:
71
+ if not cls._lib_loaded:
72
+ cls.lib = build_conditional_library(
73
+ _openssl.lib, CONDITIONAL_NAMES
74
+ )
75
+ cls._lib_loaded = True
76
+
77
+ @classmethod
78
+ def init_static_locks(cls) -> None:
79
+ cls._ensure_ffi_initialized()
80
+
81
+
82
+ def _verify_package_version(version: str) -> None:
83
+ # Occasionally we run into situations where the version of the Python
84
+ # package does not match the version of the shared object that is loaded.
85
+ # This may occur in environments where multiple versions of cryptography
86
+ # are installed and available in the python path. To avoid errors cropping
87
+ # up later this code checks that the currently imported package and the
88
+ # shared object that were loaded have the same version and raise an
89
+ # ImportError if they do not
90
+ so_package_version = _openssl.ffi.string(
91
+ _openssl.lib.CRYPTOGRAPHY_PACKAGE_VERSION
92
+ )
93
+ if version.encode("ascii") != so_package_version:
94
+ raise ImportError(
95
+ "The version of cryptography does not match the loaded "
96
+ "shared object. This can happen if you have multiple copies of "
97
+ "cryptography installed in your Python path. Please try creating "
98
+ "a new virtual environment to resolve this issue. "
99
+ f"Loaded python version: {version}, "
100
+ f"shared object version: {so_package_version}"
101
+ )
102
+
103
+ _openssl_assert(
104
+ _openssl.lib.OpenSSL_version_num() == openssl.openssl_version(),
105
+ )
106
+
107
+
108
+ _verify_package_version(cryptography.__version__)
109
+
110
+ Binding.init_static_locks()
111
+
112
+ if (
113
+ sys.platform == "win32"
114
+ and os.environ.get("PROCESSOR_ARCHITEW6432") is not None
115
+ ):
116
+ warnings.warn(
117
+ "You are using cryptography on a 32-bit Python on a 64-bit Windows "
118
+ "Operating System. Cryptography will be significantly faster if you "
119
+ "switch to using a 64-bit Python.",
120
+ UserWarning,
121
+ stacklevel=2,
122
+ )
@@ -0,0 +1,5 @@
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
@@ -0,0 +1,5 @@
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