@pairling/runtime-darwin-arm64 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/__pycache__/__future__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/_compression.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/_weakrefset.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/base64.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/bisect.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/bz2.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/calendar.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/contextlib.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/copyreg.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/datetime.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/enum.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/fnmatch.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/functools.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/hashlib.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/hmac.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/ipaddress.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/keyword.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/locale.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/lzma.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/operator.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/plistlib.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/pty.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/quopri.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/random.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/reprlib.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/selectors.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/shutil.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/signal.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/socket.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/ssl.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/string.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/struct.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/subprocess.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/tempfile.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/threading.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/tty.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/types.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/typing.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/warnings.cpython-312.pyc +0 -0
- package/python/lib/python3.12/__pycache__/weakref.cpython-312.pyc +0 -0
- package/python/lib/python3.12/collections/__pycache__/__init__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/collections/__pycache__/abc.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/__init__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/_encoded_words.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/_parseaddr.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/_policybase.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/base64mime.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/charset.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/encoders.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/errors.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/feedparser.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/header.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/iterators.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/message.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/parser.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/quoprimime.cpython-312.pyc +0 -0
- package/python/lib/python3.12/email/__pycache__/utils.cpython-312.pyc +0 -0
- package/python/lib/python3.12/encodings/__pycache__/__init__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/encodings/__pycache__/aliases.cpython-312.pyc +0 -0
- package/python/lib/python3.12/encodings/__pycache__/utf_8.cpython-312.pyc +0 -0
- package/python/lib/python3.12/http/__pycache__/__init__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/http/__pycache__/client.cpython-312.pyc +0 -0
- package/python/lib/python3.12/json/__pycache__/__init__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/json/__pycache__/decoder.cpython-312.pyc +0 -0
- package/python/lib/python3.12/json/__pycache__/encoder.cpython-312.pyc +0 -0
- package/python/lib/python3.12/json/__pycache__/scanner.cpython-312.pyc +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/re/__pycache__/__init__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/re/__pycache__/_casefix.cpython-312.pyc +0 -0
- package/python/lib/python3.12/re/__pycache__/_compiler.cpython-312.pyc +0 -0
- package/python/lib/python3.12/re/__pycache__/_constants.cpython-312.pyc +0 -0
- package/python/lib/python3.12/re/__pycache__/_parser.cpython-312.pyc +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/__pycache__/__init__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/site-packages/cffi/__pycache__/api.cpython-312.pyc +0 -0
- package/python/lib/python3.12/site-packages/cffi/__pycache__/error.cpython-312.pyc +0 -0
- package/python/lib/python3.12/site-packages/cffi/__pycache__/lock.cpython-312.pyc +0 -0
- package/python/lib/python3.12/site-packages/cffi/__pycache__/model.cpython-312.pyc +0 -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 +229 -0
- package/python/lib/python3.12/site-packages/cffi/vengine_cpy.py +1087 -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-2.0.0.dist-info/INSTALLER +1 -0
- package/python/lib/python3.12/site-packages/cffi-2.0.0.dist-info/METADATA +68 -0
- package/python/lib/python3.12/site-packages/cffi-2.0.0.dist-info/RECORD +31 -0
- package/python/lib/python3.12/site-packages/cffi-2.0.0.dist-info/WHEEL +6 -0
- package/python/lib/python3.12/site-packages/cffi-2.0.0.dist-info/entry_points.txt +2 -0
- package/python/lib/python3.12/site-packages/cffi-2.0.0.dist-info/licenses/AUTHORS +8 -0
- package/python/lib/python3.12/site-packages/cffi-2.0.0.dist-info/licenses/LICENSE +23 -0
- package/python/lib/python3.12/site-packages/cffi-2.0.0.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/__pycache__/__about__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/site-packages/cryptography/__pycache__/__init__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/site-packages/cryptography/__pycache__/utils.cpython-312.pyc +0 -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
- package/python/lib/python3.12/sqlite3/__pycache__/__init__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/sqlite3/__pycache__/dbapi2.cpython-312.pyc +0 -0
- package/python/lib/python3.12/urllib/__pycache__/__init__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/urllib/__pycache__/error.cpython-312.pyc +0 -0
- package/python/lib/python3.12/urllib/__pycache__/parse.cpython-312.pyc +0 -0
- package/python/lib/python3.12/urllib/__pycache__/request.cpython-312.pyc +0 -0
- package/python/lib/python3.12/urllib/__pycache__/response.cpython-312.pyc +0 -0
- package/python/lib/python3.12/xml/__pycache__/__init__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/xml/parsers/__pycache__/__init__.cpython-312.pyc +0 -0
- package/python/lib/python3.12/xml/parsers/__pycache__/expat.cpython-312.pyc +0 -0
|
@@ -0,0 +1,447 @@
|
|
|
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 typing
|
|
9
|
+
|
|
10
|
+
from cryptography import utils
|
|
11
|
+
from cryptography.exceptions import UnsupportedAlgorithm, _Reasons
|
|
12
|
+
from cryptography.hazmat._oid import ObjectIdentifier
|
|
13
|
+
from cryptography.hazmat.bindings._rust import openssl as rust_openssl
|
|
14
|
+
from cryptography.hazmat.primitives import _serialization, hashes
|
|
15
|
+
from cryptography.hazmat.primitives.asymmetric import utils as asym_utils
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class EllipticCurveOID:
|
|
19
|
+
SECP192R1 = ObjectIdentifier("1.2.840.10045.3.1.1")
|
|
20
|
+
SECP224R1 = ObjectIdentifier("1.3.132.0.33")
|
|
21
|
+
SECP256K1 = ObjectIdentifier("1.3.132.0.10")
|
|
22
|
+
SECP256R1 = ObjectIdentifier("1.2.840.10045.3.1.7")
|
|
23
|
+
SECP384R1 = ObjectIdentifier("1.3.132.0.34")
|
|
24
|
+
SECP521R1 = ObjectIdentifier("1.3.132.0.35")
|
|
25
|
+
BRAINPOOLP256R1 = ObjectIdentifier("1.3.36.3.3.2.8.1.1.7")
|
|
26
|
+
BRAINPOOLP384R1 = ObjectIdentifier("1.3.36.3.3.2.8.1.1.11")
|
|
27
|
+
BRAINPOOLP512R1 = ObjectIdentifier("1.3.36.3.3.2.8.1.1.13")
|
|
28
|
+
SECT163K1 = ObjectIdentifier("1.3.132.0.1")
|
|
29
|
+
SECT163R2 = ObjectIdentifier("1.3.132.0.15")
|
|
30
|
+
SECT233K1 = ObjectIdentifier("1.3.132.0.26")
|
|
31
|
+
SECT233R1 = ObjectIdentifier("1.3.132.0.27")
|
|
32
|
+
SECT283K1 = ObjectIdentifier("1.3.132.0.16")
|
|
33
|
+
SECT283R1 = ObjectIdentifier("1.3.132.0.17")
|
|
34
|
+
SECT409K1 = ObjectIdentifier("1.3.132.0.36")
|
|
35
|
+
SECT409R1 = ObjectIdentifier("1.3.132.0.37")
|
|
36
|
+
SECT571K1 = ObjectIdentifier("1.3.132.0.38")
|
|
37
|
+
SECT571R1 = ObjectIdentifier("1.3.132.0.39")
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class EllipticCurve(metaclass=abc.ABCMeta):
|
|
41
|
+
@property
|
|
42
|
+
@abc.abstractmethod
|
|
43
|
+
def name(self) -> str:
|
|
44
|
+
"""
|
|
45
|
+
The name of the curve. e.g. secp256r1.
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
@property
|
|
49
|
+
@abc.abstractmethod
|
|
50
|
+
def key_size(self) -> int:
|
|
51
|
+
"""
|
|
52
|
+
Bit size of a secret scalar for the curve.
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
@property
|
|
56
|
+
@abc.abstractmethod
|
|
57
|
+
def group_order(self) -> int:
|
|
58
|
+
"""
|
|
59
|
+
The order of the curve's group.
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class EllipticCurveSignatureAlgorithm(metaclass=abc.ABCMeta):
|
|
64
|
+
@property
|
|
65
|
+
@abc.abstractmethod
|
|
66
|
+
def algorithm(
|
|
67
|
+
self,
|
|
68
|
+
) -> asym_utils.Prehashed | hashes.HashAlgorithm:
|
|
69
|
+
"""
|
|
70
|
+
The digest algorithm used with this signature.
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
class EllipticCurvePrivateKey(metaclass=abc.ABCMeta):
|
|
75
|
+
@abc.abstractmethod
|
|
76
|
+
def exchange(
|
|
77
|
+
self, algorithm: ECDH, peer_public_key: EllipticCurvePublicKey
|
|
78
|
+
) -> bytes:
|
|
79
|
+
"""
|
|
80
|
+
Performs a key exchange operation using the provided algorithm with the
|
|
81
|
+
provided peer's public key.
|
|
82
|
+
"""
|
|
83
|
+
|
|
84
|
+
@abc.abstractmethod
|
|
85
|
+
def public_key(self) -> EllipticCurvePublicKey:
|
|
86
|
+
"""
|
|
87
|
+
The EllipticCurvePublicKey for this private key.
|
|
88
|
+
"""
|
|
89
|
+
|
|
90
|
+
@property
|
|
91
|
+
@abc.abstractmethod
|
|
92
|
+
def curve(self) -> EllipticCurve:
|
|
93
|
+
"""
|
|
94
|
+
The EllipticCurve that this key is on.
|
|
95
|
+
"""
|
|
96
|
+
|
|
97
|
+
@property
|
|
98
|
+
@abc.abstractmethod
|
|
99
|
+
def key_size(self) -> int:
|
|
100
|
+
"""
|
|
101
|
+
Bit size of a secret scalar for the curve.
|
|
102
|
+
"""
|
|
103
|
+
|
|
104
|
+
@abc.abstractmethod
|
|
105
|
+
def sign(
|
|
106
|
+
self,
|
|
107
|
+
data: utils.Buffer,
|
|
108
|
+
signature_algorithm: EllipticCurveSignatureAlgorithm,
|
|
109
|
+
) -> bytes:
|
|
110
|
+
"""
|
|
111
|
+
Signs the data
|
|
112
|
+
"""
|
|
113
|
+
|
|
114
|
+
@abc.abstractmethod
|
|
115
|
+
def private_numbers(self) -> EllipticCurvePrivateNumbers:
|
|
116
|
+
"""
|
|
117
|
+
Returns an EllipticCurvePrivateNumbers.
|
|
118
|
+
"""
|
|
119
|
+
|
|
120
|
+
@abc.abstractmethod
|
|
121
|
+
def private_bytes(
|
|
122
|
+
self,
|
|
123
|
+
encoding: _serialization.Encoding,
|
|
124
|
+
format: _serialization.PrivateFormat,
|
|
125
|
+
encryption_algorithm: _serialization.KeySerializationEncryption,
|
|
126
|
+
) -> bytes:
|
|
127
|
+
"""
|
|
128
|
+
Returns the key serialized as bytes.
|
|
129
|
+
"""
|
|
130
|
+
|
|
131
|
+
@abc.abstractmethod
|
|
132
|
+
def __copy__(self) -> EllipticCurvePrivateKey:
|
|
133
|
+
"""
|
|
134
|
+
Returns a copy.
|
|
135
|
+
"""
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
EllipticCurvePrivateKeyWithSerialization = EllipticCurvePrivateKey
|
|
139
|
+
EllipticCurvePrivateKey.register(rust_openssl.ec.ECPrivateKey)
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
class EllipticCurvePublicKey(metaclass=abc.ABCMeta):
|
|
143
|
+
@property
|
|
144
|
+
@abc.abstractmethod
|
|
145
|
+
def curve(self) -> EllipticCurve:
|
|
146
|
+
"""
|
|
147
|
+
The EllipticCurve that this key is on.
|
|
148
|
+
"""
|
|
149
|
+
|
|
150
|
+
@property
|
|
151
|
+
@abc.abstractmethod
|
|
152
|
+
def key_size(self) -> int:
|
|
153
|
+
"""
|
|
154
|
+
Bit size of a secret scalar for the curve.
|
|
155
|
+
"""
|
|
156
|
+
|
|
157
|
+
@abc.abstractmethod
|
|
158
|
+
def public_numbers(self) -> EllipticCurvePublicNumbers:
|
|
159
|
+
"""
|
|
160
|
+
Returns an EllipticCurvePublicNumbers.
|
|
161
|
+
"""
|
|
162
|
+
|
|
163
|
+
@abc.abstractmethod
|
|
164
|
+
def public_bytes(
|
|
165
|
+
self,
|
|
166
|
+
encoding: _serialization.Encoding,
|
|
167
|
+
format: _serialization.PublicFormat,
|
|
168
|
+
) -> bytes:
|
|
169
|
+
"""
|
|
170
|
+
Returns the key serialized as bytes.
|
|
171
|
+
"""
|
|
172
|
+
|
|
173
|
+
@abc.abstractmethod
|
|
174
|
+
def verify(
|
|
175
|
+
self,
|
|
176
|
+
signature: utils.Buffer,
|
|
177
|
+
data: utils.Buffer,
|
|
178
|
+
signature_algorithm: EllipticCurveSignatureAlgorithm,
|
|
179
|
+
) -> None:
|
|
180
|
+
"""
|
|
181
|
+
Verifies the signature of the data.
|
|
182
|
+
"""
|
|
183
|
+
|
|
184
|
+
@classmethod
|
|
185
|
+
def from_encoded_point(
|
|
186
|
+
cls, curve: EllipticCurve, data: bytes
|
|
187
|
+
) -> EllipticCurvePublicKey:
|
|
188
|
+
utils._check_bytes("data", data)
|
|
189
|
+
|
|
190
|
+
if len(data) == 0:
|
|
191
|
+
raise ValueError("data must not be an empty byte string")
|
|
192
|
+
|
|
193
|
+
if data[0] not in [0x02, 0x03, 0x04]:
|
|
194
|
+
raise ValueError("Unsupported elliptic curve point type")
|
|
195
|
+
|
|
196
|
+
return rust_openssl.ec.from_public_bytes(curve, data)
|
|
197
|
+
|
|
198
|
+
@abc.abstractmethod
|
|
199
|
+
def __eq__(self, other: object) -> bool:
|
|
200
|
+
"""
|
|
201
|
+
Checks equality.
|
|
202
|
+
"""
|
|
203
|
+
|
|
204
|
+
@abc.abstractmethod
|
|
205
|
+
def __copy__(self) -> EllipticCurvePublicKey:
|
|
206
|
+
"""
|
|
207
|
+
Returns a copy.
|
|
208
|
+
"""
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
EllipticCurvePublicKeyWithSerialization = EllipticCurvePublicKey
|
|
212
|
+
EllipticCurvePublicKey.register(rust_openssl.ec.ECPublicKey)
|
|
213
|
+
|
|
214
|
+
EllipticCurvePrivateNumbers = rust_openssl.ec.EllipticCurvePrivateNumbers
|
|
215
|
+
EllipticCurvePublicNumbers = rust_openssl.ec.EllipticCurvePublicNumbers
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
class SECT571R1(EllipticCurve):
|
|
219
|
+
name = "sect571r1"
|
|
220
|
+
key_size = 570
|
|
221
|
+
group_order = 0x3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE661CE18FF55987308059B186823851EC7DD9CA1161DE93D5174D66E8382E9BB2FE84E47 # noqa: E501
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
class SECT409R1(EllipticCurve):
|
|
225
|
+
name = "sect409r1"
|
|
226
|
+
key_size = 409
|
|
227
|
+
group_order = 0x10000000000000000000000000000000000000000000000000001E2AAD6A612F33307BE5FA47C3C9E052F838164CD37D9A21173 # noqa: E501
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
class SECT283R1(EllipticCurve):
|
|
231
|
+
name = "sect283r1"
|
|
232
|
+
key_size = 283
|
|
233
|
+
group_order = 0x3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEF90399660FC938A90165B042A7CEFADB307 # noqa: E501
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
class SECT233R1(EllipticCurve):
|
|
237
|
+
name = "sect233r1"
|
|
238
|
+
key_size = 233
|
|
239
|
+
group_order = 0x1000000000000000000000000000013E974E72F8A6922031D2603CFE0D7
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
class SECT163R2(EllipticCurve):
|
|
243
|
+
name = "sect163r2"
|
|
244
|
+
key_size = 163
|
|
245
|
+
group_order = 0x40000000000000000000292FE77E70C12A4234C33
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
class SECT571K1(EllipticCurve):
|
|
249
|
+
name = "sect571k1"
|
|
250
|
+
key_size = 571
|
|
251
|
+
group_order = 0x20000000000000000000000000000000000000000000000000000000000000000000000131850E1F19A63E4B391A8DB917F4138B630D84BE5D639381E91DEB45CFE778F637C1001 # noqa: E501
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
class SECT409K1(EllipticCurve):
|
|
255
|
+
name = "sect409k1"
|
|
256
|
+
key_size = 409
|
|
257
|
+
group_order = 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5F83B2D4EA20400EC4557D5ED3E3E7CA5B4B5C83B8E01E5FCF # noqa: E501
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
class SECT283K1(EllipticCurve):
|
|
261
|
+
name = "sect283k1"
|
|
262
|
+
key_size = 283
|
|
263
|
+
group_order = 0x1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9AE2ED07577265DFF7F94451E061E163C61 # noqa: E501
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
class SECT233K1(EllipticCurve):
|
|
267
|
+
name = "sect233k1"
|
|
268
|
+
key_size = 233
|
|
269
|
+
group_order = 0x8000000000000000000000000000069D5BB915BCD46EFB1AD5F173ABDF
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
class SECT163K1(EllipticCurve):
|
|
273
|
+
name = "sect163k1"
|
|
274
|
+
key_size = 163
|
|
275
|
+
group_order = 0x4000000000000000000020108A2E0CC0D99F8A5EF
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
class SECP521R1(EllipticCurve):
|
|
279
|
+
name = "secp521r1"
|
|
280
|
+
key_size = 521
|
|
281
|
+
group_order = 0x1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409 # noqa: E501
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
class SECP384R1(EllipticCurve):
|
|
285
|
+
name = "secp384r1"
|
|
286
|
+
key_size = 384
|
|
287
|
+
group_order = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973 # noqa: E501
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
class SECP256R1(EllipticCurve):
|
|
291
|
+
name = "secp256r1"
|
|
292
|
+
key_size = 256
|
|
293
|
+
group_order = (
|
|
294
|
+
0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551
|
|
295
|
+
)
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
class SECP256K1(EllipticCurve):
|
|
299
|
+
name = "secp256k1"
|
|
300
|
+
key_size = 256
|
|
301
|
+
group_order = (
|
|
302
|
+
0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141
|
|
303
|
+
)
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
class SECP224R1(EllipticCurve):
|
|
307
|
+
name = "secp224r1"
|
|
308
|
+
key_size = 224
|
|
309
|
+
group_order = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
class SECP192R1(EllipticCurve):
|
|
313
|
+
name = "secp192r1"
|
|
314
|
+
key_size = 192
|
|
315
|
+
group_order = 0xFFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
class BrainpoolP256R1(EllipticCurve):
|
|
319
|
+
name = "brainpoolP256r1"
|
|
320
|
+
key_size = 256
|
|
321
|
+
group_order = (
|
|
322
|
+
0xA9FB57DBA1EEA9BC3E660A909D838D718C397AA3B561A6F7901E0E82974856A7
|
|
323
|
+
)
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
class BrainpoolP384R1(EllipticCurve):
|
|
327
|
+
name = "brainpoolP384r1"
|
|
328
|
+
key_size = 384
|
|
329
|
+
group_order = 0x8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B31F166E6CAC0425A7CF3AB6AF6B7FC3103B883202E9046565 # noqa: E501
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
class BrainpoolP512R1(EllipticCurve):
|
|
333
|
+
name = "brainpoolP512r1"
|
|
334
|
+
key_size = 512
|
|
335
|
+
group_order = 0xAADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA70330870553E5C414CA92619418661197FAC10471DB1D381085DDADDB58796829CA90069 # noqa: E501
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
_CURVE_TYPES: dict[str, EllipticCurve] = {
|
|
339
|
+
"prime192v1": SECP192R1(),
|
|
340
|
+
"prime256v1": SECP256R1(),
|
|
341
|
+
"secp192r1": SECP192R1(),
|
|
342
|
+
"secp224r1": SECP224R1(),
|
|
343
|
+
"secp256r1": SECP256R1(),
|
|
344
|
+
"secp384r1": SECP384R1(),
|
|
345
|
+
"secp521r1": SECP521R1(),
|
|
346
|
+
"secp256k1": SECP256K1(),
|
|
347
|
+
"sect163k1": SECT163K1(),
|
|
348
|
+
"sect233k1": SECT233K1(),
|
|
349
|
+
"sect283k1": SECT283K1(),
|
|
350
|
+
"sect409k1": SECT409K1(),
|
|
351
|
+
"sect571k1": SECT571K1(),
|
|
352
|
+
"sect163r2": SECT163R2(),
|
|
353
|
+
"sect233r1": SECT233R1(),
|
|
354
|
+
"sect283r1": SECT283R1(),
|
|
355
|
+
"sect409r1": SECT409R1(),
|
|
356
|
+
"sect571r1": SECT571R1(),
|
|
357
|
+
"brainpoolP256r1": BrainpoolP256R1(),
|
|
358
|
+
"brainpoolP384r1": BrainpoolP384R1(),
|
|
359
|
+
"brainpoolP512r1": BrainpoolP512R1(),
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
class ECDSA(EllipticCurveSignatureAlgorithm):
|
|
364
|
+
def __init__(
|
|
365
|
+
self,
|
|
366
|
+
algorithm: asym_utils.Prehashed | hashes.HashAlgorithm,
|
|
367
|
+
deterministic_signing: bool = False,
|
|
368
|
+
):
|
|
369
|
+
from cryptography.hazmat.backends.openssl.backend import backend
|
|
370
|
+
|
|
371
|
+
if (
|
|
372
|
+
deterministic_signing
|
|
373
|
+
and not backend.ecdsa_deterministic_supported()
|
|
374
|
+
):
|
|
375
|
+
raise UnsupportedAlgorithm(
|
|
376
|
+
"ECDSA with deterministic signature (RFC 6979) is not "
|
|
377
|
+
"supported by this version of OpenSSL.",
|
|
378
|
+
_Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM,
|
|
379
|
+
)
|
|
380
|
+
self._algorithm = algorithm
|
|
381
|
+
self._deterministic_signing = deterministic_signing
|
|
382
|
+
|
|
383
|
+
@property
|
|
384
|
+
def algorithm(
|
|
385
|
+
self,
|
|
386
|
+
) -> asym_utils.Prehashed | hashes.HashAlgorithm:
|
|
387
|
+
return self._algorithm
|
|
388
|
+
|
|
389
|
+
@property
|
|
390
|
+
def deterministic_signing(
|
|
391
|
+
self,
|
|
392
|
+
) -> bool:
|
|
393
|
+
return self._deterministic_signing
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
generate_private_key = rust_openssl.ec.generate_private_key
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
def derive_private_key(
|
|
400
|
+
private_value: int,
|
|
401
|
+
curve: EllipticCurve,
|
|
402
|
+
backend: typing.Any = None,
|
|
403
|
+
) -> EllipticCurvePrivateKey:
|
|
404
|
+
if not isinstance(private_value, int):
|
|
405
|
+
raise TypeError("private_value must be an integer type.")
|
|
406
|
+
|
|
407
|
+
if private_value <= 0:
|
|
408
|
+
raise ValueError("private_value must be a positive integer.")
|
|
409
|
+
|
|
410
|
+
return rust_openssl.ec.derive_private_key(private_value, curve)
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
class ECDH:
|
|
414
|
+
pass
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
_OID_TO_CURVE = {
|
|
418
|
+
EllipticCurveOID.SECP192R1: SECP192R1,
|
|
419
|
+
EllipticCurveOID.SECP224R1: SECP224R1,
|
|
420
|
+
EllipticCurveOID.SECP256K1: SECP256K1,
|
|
421
|
+
EllipticCurveOID.SECP256R1: SECP256R1,
|
|
422
|
+
EllipticCurveOID.SECP384R1: SECP384R1,
|
|
423
|
+
EllipticCurveOID.SECP521R1: SECP521R1,
|
|
424
|
+
EllipticCurveOID.BRAINPOOLP256R1: BrainpoolP256R1,
|
|
425
|
+
EllipticCurveOID.BRAINPOOLP384R1: BrainpoolP384R1,
|
|
426
|
+
EllipticCurveOID.BRAINPOOLP512R1: BrainpoolP512R1,
|
|
427
|
+
EllipticCurveOID.SECT163K1: SECT163K1,
|
|
428
|
+
EllipticCurveOID.SECT163R2: SECT163R2,
|
|
429
|
+
EllipticCurveOID.SECT233K1: SECT233K1,
|
|
430
|
+
EllipticCurveOID.SECT233R1: SECT233R1,
|
|
431
|
+
EllipticCurveOID.SECT283K1: SECT283K1,
|
|
432
|
+
EllipticCurveOID.SECT283R1: SECT283R1,
|
|
433
|
+
EllipticCurveOID.SECT409K1: SECT409K1,
|
|
434
|
+
EllipticCurveOID.SECT409R1: SECT409R1,
|
|
435
|
+
EllipticCurveOID.SECT571K1: SECT571K1,
|
|
436
|
+
EllipticCurveOID.SECT571R1: SECT571R1,
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
def get_curve_for_oid(oid: ObjectIdentifier) -> type[EllipticCurve]:
|
|
441
|
+
try:
|
|
442
|
+
return _OID_TO_CURVE[oid]
|
|
443
|
+
except KeyError:
|
|
444
|
+
raise LookupError(
|
|
445
|
+
"The provided object identifier has no matching elliptic "
|
|
446
|
+
"curve class"
|
|
447
|
+
)
|
package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ed25519.py
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
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
|
+
|
|
9
|
+
from cryptography.exceptions import UnsupportedAlgorithm, _Reasons
|
|
10
|
+
from cryptography.hazmat.bindings._rust import openssl as rust_openssl
|
|
11
|
+
from cryptography.hazmat.primitives import _serialization
|
|
12
|
+
from cryptography.utils import Buffer
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Ed25519PublicKey(metaclass=abc.ABCMeta):
|
|
16
|
+
@classmethod
|
|
17
|
+
def from_public_bytes(cls, data: bytes) -> Ed25519PublicKey:
|
|
18
|
+
from cryptography.hazmat.backends.openssl.backend import backend
|
|
19
|
+
|
|
20
|
+
if not backend.ed25519_supported():
|
|
21
|
+
raise UnsupportedAlgorithm(
|
|
22
|
+
"ed25519 is not supported by this version of OpenSSL.",
|
|
23
|
+
_Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM,
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
return rust_openssl.ed25519.from_public_bytes(data)
|
|
27
|
+
|
|
28
|
+
@abc.abstractmethod
|
|
29
|
+
def public_bytes(
|
|
30
|
+
self,
|
|
31
|
+
encoding: _serialization.Encoding,
|
|
32
|
+
format: _serialization.PublicFormat,
|
|
33
|
+
) -> bytes:
|
|
34
|
+
"""
|
|
35
|
+
The serialized bytes of the public key.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
@abc.abstractmethod
|
|
39
|
+
def public_bytes_raw(self) -> bytes:
|
|
40
|
+
"""
|
|
41
|
+
The raw bytes of the public key.
|
|
42
|
+
Equivalent to public_bytes(Raw, Raw).
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
@abc.abstractmethod
|
|
46
|
+
def verify(self, signature: Buffer, data: Buffer) -> None:
|
|
47
|
+
"""
|
|
48
|
+
Verify the signature.
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
@abc.abstractmethod
|
|
52
|
+
def __eq__(self, other: object) -> bool:
|
|
53
|
+
"""
|
|
54
|
+
Checks equality.
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
@abc.abstractmethod
|
|
58
|
+
def __copy__(self) -> Ed25519PublicKey:
|
|
59
|
+
"""
|
|
60
|
+
Returns a copy.
|
|
61
|
+
"""
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
Ed25519PublicKey.register(rust_openssl.ed25519.Ed25519PublicKey)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class Ed25519PrivateKey(metaclass=abc.ABCMeta):
|
|
68
|
+
@classmethod
|
|
69
|
+
def generate(cls) -> Ed25519PrivateKey:
|
|
70
|
+
from cryptography.hazmat.backends.openssl.backend import backend
|
|
71
|
+
|
|
72
|
+
if not backend.ed25519_supported():
|
|
73
|
+
raise UnsupportedAlgorithm(
|
|
74
|
+
"ed25519 is not supported by this version of OpenSSL.",
|
|
75
|
+
_Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
return rust_openssl.ed25519.generate_key()
|
|
79
|
+
|
|
80
|
+
@classmethod
|
|
81
|
+
def from_private_bytes(cls, data: Buffer) -> Ed25519PrivateKey:
|
|
82
|
+
from cryptography.hazmat.backends.openssl.backend import backend
|
|
83
|
+
|
|
84
|
+
if not backend.ed25519_supported():
|
|
85
|
+
raise UnsupportedAlgorithm(
|
|
86
|
+
"ed25519 is not supported by this version of OpenSSL.",
|
|
87
|
+
_Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM,
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
return rust_openssl.ed25519.from_private_bytes(data)
|
|
91
|
+
|
|
92
|
+
@abc.abstractmethod
|
|
93
|
+
def public_key(self) -> Ed25519PublicKey:
|
|
94
|
+
"""
|
|
95
|
+
The Ed25519PublicKey derived from the private key.
|
|
96
|
+
"""
|
|
97
|
+
|
|
98
|
+
@abc.abstractmethod
|
|
99
|
+
def private_bytes(
|
|
100
|
+
self,
|
|
101
|
+
encoding: _serialization.Encoding,
|
|
102
|
+
format: _serialization.PrivateFormat,
|
|
103
|
+
encryption_algorithm: _serialization.KeySerializationEncryption,
|
|
104
|
+
) -> bytes:
|
|
105
|
+
"""
|
|
106
|
+
The serialized bytes of the private key.
|
|
107
|
+
"""
|
|
108
|
+
|
|
109
|
+
@abc.abstractmethod
|
|
110
|
+
def private_bytes_raw(self) -> bytes:
|
|
111
|
+
"""
|
|
112
|
+
The raw bytes of the private key.
|
|
113
|
+
Equivalent to private_bytes(Raw, Raw, NoEncryption()).
|
|
114
|
+
"""
|
|
115
|
+
|
|
116
|
+
@abc.abstractmethod
|
|
117
|
+
def sign(self, data: Buffer) -> bytes:
|
|
118
|
+
"""
|
|
119
|
+
Signs the data.
|
|
120
|
+
"""
|
|
121
|
+
|
|
122
|
+
@abc.abstractmethod
|
|
123
|
+
def __copy__(self) -> Ed25519PrivateKey:
|
|
124
|
+
"""
|
|
125
|
+
Returns a copy.
|
|
126
|
+
"""
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
Ed25519PrivateKey.register(rust_openssl.ed25519.Ed25519PrivateKey)
|
package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ed448.py
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
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
|
+
|
|
9
|
+
from cryptography.exceptions import UnsupportedAlgorithm, _Reasons
|
|
10
|
+
from cryptography.hazmat.bindings._rust import openssl as rust_openssl
|
|
11
|
+
from cryptography.hazmat.primitives import _serialization
|
|
12
|
+
from cryptography.utils import Buffer
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Ed448PublicKey(metaclass=abc.ABCMeta):
|
|
16
|
+
@classmethod
|
|
17
|
+
def from_public_bytes(cls, data: bytes) -> Ed448PublicKey:
|
|
18
|
+
from cryptography.hazmat.backends.openssl.backend import backend
|
|
19
|
+
|
|
20
|
+
if not backend.ed448_supported():
|
|
21
|
+
raise UnsupportedAlgorithm(
|
|
22
|
+
"ed448 is not supported by this version of OpenSSL.",
|
|
23
|
+
_Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM,
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
return rust_openssl.ed448.from_public_bytes(data)
|
|
27
|
+
|
|
28
|
+
@abc.abstractmethod
|
|
29
|
+
def public_bytes(
|
|
30
|
+
self,
|
|
31
|
+
encoding: _serialization.Encoding,
|
|
32
|
+
format: _serialization.PublicFormat,
|
|
33
|
+
) -> bytes:
|
|
34
|
+
"""
|
|
35
|
+
The serialized bytes of the public key.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
@abc.abstractmethod
|
|
39
|
+
def public_bytes_raw(self) -> bytes:
|
|
40
|
+
"""
|
|
41
|
+
The raw bytes of the public key.
|
|
42
|
+
Equivalent to public_bytes(Raw, Raw).
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
@abc.abstractmethod
|
|
46
|
+
def verify(self, signature: Buffer, data: Buffer) -> None:
|
|
47
|
+
"""
|
|
48
|
+
Verify the signature.
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
@abc.abstractmethod
|
|
52
|
+
def __eq__(self, other: object) -> bool:
|
|
53
|
+
"""
|
|
54
|
+
Checks equality.
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
@abc.abstractmethod
|
|
58
|
+
def __copy__(self) -> Ed448PublicKey:
|
|
59
|
+
"""
|
|
60
|
+
Returns a copy.
|
|
61
|
+
"""
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
if hasattr(rust_openssl, "ed448"):
|
|
65
|
+
Ed448PublicKey.register(rust_openssl.ed448.Ed448PublicKey)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class Ed448PrivateKey(metaclass=abc.ABCMeta):
|
|
69
|
+
@classmethod
|
|
70
|
+
def generate(cls) -> Ed448PrivateKey:
|
|
71
|
+
from cryptography.hazmat.backends.openssl.backend import backend
|
|
72
|
+
|
|
73
|
+
if not backend.ed448_supported():
|
|
74
|
+
raise UnsupportedAlgorithm(
|
|
75
|
+
"ed448 is not supported by this version of OpenSSL.",
|
|
76
|
+
_Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
return rust_openssl.ed448.generate_key()
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_private_bytes(cls, data: Buffer) -> Ed448PrivateKey:
|
|
83
|
+
from cryptography.hazmat.backends.openssl.backend import backend
|
|
84
|
+
|
|
85
|
+
if not backend.ed448_supported():
|
|
86
|
+
raise UnsupportedAlgorithm(
|
|
87
|
+
"ed448 is not supported by this version of OpenSSL.",
|
|
88
|
+
_Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
return rust_openssl.ed448.from_private_bytes(data)
|
|
92
|
+
|
|
93
|
+
@abc.abstractmethod
|
|
94
|
+
def public_key(self) -> Ed448PublicKey:
|
|
95
|
+
"""
|
|
96
|
+
The Ed448PublicKey derived from the private key.
|
|
97
|
+
"""
|
|
98
|
+
|
|
99
|
+
@abc.abstractmethod
|
|
100
|
+
def sign(self, data: Buffer) -> bytes:
|
|
101
|
+
"""
|
|
102
|
+
Signs the data.
|
|
103
|
+
"""
|
|
104
|
+
|
|
105
|
+
@abc.abstractmethod
|
|
106
|
+
def private_bytes(
|
|
107
|
+
self,
|
|
108
|
+
encoding: _serialization.Encoding,
|
|
109
|
+
format: _serialization.PrivateFormat,
|
|
110
|
+
encryption_algorithm: _serialization.KeySerializationEncryption,
|
|
111
|
+
) -> bytes:
|
|
112
|
+
"""
|
|
113
|
+
The serialized bytes of the private key.
|
|
114
|
+
"""
|
|
115
|
+
|
|
116
|
+
@abc.abstractmethod
|
|
117
|
+
def private_bytes_raw(self) -> bytes:
|
|
118
|
+
"""
|
|
119
|
+
The raw bytes of the private key.
|
|
120
|
+
Equivalent to private_bytes(Raw, Raw, NoEncryption()).
|
|
121
|
+
"""
|
|
122
|
+
|
|
123
|
+
@abc.abstractmethod
|
|
124
|
+
def __copy__(self) -> Ed448PrivateKey:
|
|
125
|
+
"""
|
|
126
|
+
Returns a copy.
|
|
127
|
+
"""
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
if hasattr(rust_openssl, "x448"):
|
|
131
|
+
Ed448PrivateKey.register(rust_openssl.ed448.Ed448PrivateKey)
|