initial commit
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
# This file is dual licensed under the terms of the Apache License, Version
|
||||
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
||||
# for complete details.
|
||||
|
||||
import typing
|
||||
|
||||
from cryptography.hazmat.bindings._rust.openssl import (
|
||||
dh,
|
||||
dsa,
|
||||
ed448,
|
||||
ed25519,
|
||||
hashes,
|
||||
hmac,
|
||||
kdf,
|
||||
poly1305,
|
||||
x448,
|
||||
x25519,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"openssl_version",
|
||||
"raise_openssl_error",
|
||||
"dh",
|
||||
"dsa",
|
||||
"hashes",
|
||||
"hmac",
|
||||
"kdf",
|
||||
"ed448",
|
||||
"ed25519",
|
||||
"poly1305",
|
||||
"x448",
|
||||
"x25519",
|
||||
]
|
||||
|
||||
def openssl_version() -> int: ...
|
||||
def raise_openssl_error() -> typing.NoReturn: ...
|
||||
def capture_error_stack() -> typing.List[OpenSSLError]: ...
|
||||
def is_fips_enabled() -> bool: ...
|
||||
|
||||
class OpenSSLError:
|
||||
@property
|
||||
def lib(self) -> int: ...
|
||||
@property
|
||||
def reason(self) -> int: ...
|
||||
@property
|
||||
def reason_text(self) -> bytes: ...
|
||||
def _lib_reason_match(self, lib: int, reason: int) -> bool: ...
|
||||
22
jwt/python/cryptography/hazmat/bindings/_rust/openssl/dh.pyi
Normal file
22
jwt/python/cryptography/hazmat/bindings/_rust/openssl/dh.pyi
Normal file
@@ -0,0 +1,22 @@
|
||||
# This file is dual licensed under the terms of the Apache License, Version
|
||||
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
||||
# for complete details.
|
||||
|
||||
from cryptography.hazmat.primitives.asymmetric import dh
|
||||
|
||||
MIN_MODULUS_SIZE: int
|
||||
|
||||
class DHPrivateKey: ...
|
||||
class DHPublicKey: ...
|
||||
class DHParameters: ...
|
||||
|
||||
def generate_parameters(generator: int, key_size: int) -> dh.DHParameters: ...
|
||||
def private_key_from_ptr(ptr: int) -> dh.DHPrivateKey: ...
|
||||
def public_key_from_ptr(ptr: int) -> dh.DHPublicKey: ...
|
||||
def from_pem_parameters(data: bytes) -> dh.DHParameters: ...
|
||||
def from_der_parameters(data: bytes) -> dh.DHParameters: ...
|
||||
def from_private_numbers(numbers: dh.DHPrivateNumbers) -> dh.DHPrivateKey: ...
|
||||
def from_public_numbers(numbers: dh.DHPublicNumbers) -> dh.DHPublicKey: ...
|
||||
def from_parameter_numbers(
|
||||
numbers: dh.DHParameterNumbers,
|
||||
) -> dh.DHParameters: ...
|
||||
@@ -0,0 +1,20 @@
|
||||
# This file is dual licensed under the terms of the Apache License, Version
|
||||
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
||||
# for complete details.
|
||||
|
||||
from cryptography.hazmat.primitives.asymmetric import dsa
|
||||
|
||||
class DSAPrivateKey: ...
|
||||
class DSAPublicKey: ...
|
||||
class DSAParameters: ...
|
||||
|
||||
def generate_parameters(key_size: int) -> dsa.DSAParameters: ...
|
||||
def private_key_from_ptr(ptr: int) -> dsa.DSAPrivateKey: ...
|
||||
def public_key_from_ptr(ptr: int) -> dsa.DSAPublicKey: ...
|
||||
def from_private_numbers(
|
||||
numbers: dsa.DSAPrivateNumbers,
|
||||
) -> dsa.DSAPrivateKey: ...
|
||||
def from_public_numbers(numbers: dsa.DSAPublicNumbers) -> dsa.DSAPublicKey: ...
|
||||
def from_parameter_numbers(
|
||||
numbers: dsa.DSAParameterNumbers,
|
||||
) -> dsa.DSAParameters: ...
|
||||
@@ -0,0 +1,14 @@
|
||||
# This file is dual licensed under the terms of the Apache License, Version
|
||||
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
||||
# for complete details.
|
||||
|
||||
from cryptography.hazmat.primitives.asymmetric import ed25519
|
||||
|
||||
class Ed25519PrivateKey: ...
|
||||
class Ed25519PublicKey: ...
|
||||
|
||||
def generate_key() -> ed25519.Ed25519PrivateKey: ...
|
||||
def private_key_from_ptr(ptr: int) -> ed25519.Ed25519PrivateKey: ...
|
||||
def public_key_from_ptr(ptr: int) -> ed25519.Ed25519PublicKey: ...
|
||||
def from_private_bytes(data: bytes) -> ed25519.Ed25519PrivateKey: ...
|
||||
def from_public_bytes(data: bytes) -> ed25519.Ed25519PublicKey: ...
|
||||
@@ -0,0 +1,14 @@
|
||||
# This file is dual licensed under the terms of the Apache License, Version
|
||||
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
||||
# for complete details.
|
||||
|
||||
from cryptography.hazmat.primitives.asymmetric import ed448
|
||||
|
||||
class Ed448PrivateKey: ...
|
||||
class Ed448PublicKey: ...
|
||||
|
||||
def generate_key() -> ed448.Ed448PrivateKey: ...
|
||||
def private_key_from_ptr(ptr: int) -> ed448.Ed448PrivateKey: ...
|
||||
def public_key_from_ptr(ptr: int) -> ed448.Ed448PublicKey: ...
|
||||
def from_private_bytes(data: bytes) -> ed448.Ed448PrivateKey: ...
|
||||
def from_public_bytes(data: bytes) -> ed448.Ed448PublicKey: ...
|
||||
@@ -0,0 +1,17 @@
|
||||
# This file is dual licensed under the terms of the Apache License, Version
|
||||
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
||||
# for complete details.
|
||||
|
||||
import typing
|
||||
|
||||
from cryptography.hazmat.primitives import hashes
|
||||
|
||||
class Hash(hashes.HashContext):
|
||||
def __init__(
|
||||
self, algorithm: hashes.HashAlgorithm, backend: typing.Any = None
|
||||
) -> None: ...
|
||||
@property
|
||||
def algorithm(self) -> hashes.HashAlgorithm: ...
|
||||
def update(self, data: bytes) -> None: ...
|
||||
def finalize(self) -> bytes: ...
|
||||
def copy(self) -> Hash: ...
|
||||
@@ -0,0 +1,21 @@
|
||||
# This file is dual licensed under the terms of the Apache License, Version
|
||||
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
||||
# for complete details.
|
||||
|
||||
import typing
|
||||
|
||||
from cryptography.hazmat.primitives import hashes
|
||||
|
||||
class HMAC(hashes.HashContext):
|
||||
def __init__(
|
||||
self,
|
||||
key: bytes,
|
||||
algorithm: hashes.HashAlgorithm,
|
||||
backend: typing.Any = None,
|
||||
) -> None: ...
|
||||
@property
|
||||
def algorithm(self) -> hashes.HashAlgorithm: ...
|
||||
def update(self, data: bytes) -> None: ...
|
||||
def finalize(self) -> bytes: ...
|
||||
def verify(self, signature: bytes) -> None: ...
|
||||
def copy(self) -> HMAC: ...
|
||||
@@ -0,0 +1,22 @@
|
||||
# This file is dual licensed under the terms of the Apache License, Version
|
||||
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
||||
# for complete details.
|
||||
|
||||
from cryptography.hazmat.primitives.hashes import HashAlgorithm
|
||||
|
||||
def derive_pbkdf2_hmac(
|
||||
key_material: bytes,
|
||||
algorithm: HashAlgorithm,
|
||||
salt: bytes,
|
||||
iterations: int,
|
||||
length: int,
|
||||
) -> bytes: ...
|
||||
def derive_scrypt(
|
||||
key_material: bytes,
|
||||
salt: bytes,
|
||||
n: int,
|
||||
r: int,
|
||||
p: int,
|
||||
max_mem: int,
|
||||
length: int,
|
||||
) -> bytes: ...
|
||||
@@ -0,0 +1,13 @@
|
||||
# This file is dual licensed under the terms of the Apache License, Version
|
||||
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
||||
# for complete details.
|
||||
|
||||
class Poly1305:
|
||||
def __init__(self, key: bytes) -> None: ...
|
||||
@staticmethod
|
||||
def generate_tag(key: bytes, data: bytes) -> bytes: ...
|
||||
@staticmethod
|
||||
def verify_tag(key: bytes, data: bytes, tag: bytes) -> None: ...
|
||||
def update(self, data: bytes) -> None: ...
|
||||
def finalize(self) -> bytes: ...
|
||||
def verify(self, tag: bytes) -> None: ...
|
||||
@@ -0,0 +1,14 @@
|
||||
# This file is dual licensed under the terms of the Apache License, Version
|
||||
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
||||
# for complete details.
|
||||
|
||||
from cryptography.hazmat.primitives.asymmetric import x25519
|
||||
|
||||
class X25519PrivateKey: ...
|
||||
class X25519PublicKey: ...
|
||||
|
||||
def generate_key() -> x25519.X25519PrivateKey: ...
|
||||
def private_key_from_ptr(ptr: int) -> x25519.X25519PrivateKey: ...
|
||||
def public_key_from_ptr(ptr: int) -> x25519.X25519PublicKey: ...
|
||||
def from_private_bytes(data: bytes) -> x25519.X25519PrivateKey: ...
|
||||
def from_public_bytes(data: bytes) -> x25519.X25519PublicKey: ...
|
||||
@@ -0,0 +1,14 @@
|
||||
# This file is dual licensed under the terms of the Apache License, Version
|
||||
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
||||
# for complete details.
|
||||
|
||||
from cryptography.hazmat.primitives.asymmetric import x448
|
||||
|
||||
class X448PrivateKey: ...
|
||||
class X448PublicKey: ...
|
||||
|
||||
def generate_key() -> x448.X448PrivateKey: ...
|
||||
def private_key_from_ptr(ptr: int) -> x448.X448PrivateKey: ...
|
||||
def public_key_from_ptr(ptr: int) -> x448.X448PublicKey: ...
|
||||
def from_private_bytes(data: bytes) -> x448.X448PrivateKey: ...
|
||||
def from_public_bytes(data: bytes) -> x448.X448PublicKey: ...
|
||||
Reference in New Issue
Block a user