Skip to content

Commit 6fc1237

Browse files
committed
2.1.6
1 parent cc604e6 commit 6fc1237

32 files changed

Lines changed: 876 additions & 1 deletion
174 KB
Binary file not shown.
Binary file not shown.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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 typing
6+
7+
from cryptography.hazmat.primitives import padding
8+
9+
def check_pkcs7_padding(data: bytes) -> bool: ...
10+
def check_ansix923_padding(data: bytes) -> bool: ...
11+
12+
class PKCS7PaddingContext(padding.PaddingContext):
13+
def __init__(self, block_size: int) -> None: ...
14+
def update(self, data: bytes) -> bytes: ...
15+
def finalize(self) -> bytes: ...
16+
17+
class ObjectIdentifier:
18+
def __init__(self, val: str) -> None: ...
19+
@property
20+
def dotted_string(self) -> str: ...
21+
@property
22+
def _name(self) -> str: ...
23+
24+
T = typing.TypeVar("T")
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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 typing
6+
7+
lib = typing.Any
8+
ffi = typing.Any
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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+
def decode_dss_signature(signature: bytes) -> tuple[int, int]: ...
6+
def encode_dss_signature(r: int, s: int) -> bytes: ...
7+
def parse_spki_for_data(data: bytes) -> bytes: ...
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
class _Reasons:
6+
BACKEND_MISSING_INTERFACE: _Reasons
7+
UNSUPPORTED_HASH: _Reasons
8+
UNSUPPORTED_CIPHER: _Reasons
9+
UNSUPPORTED_PADDING: _Reasons
10+
UNSUPPORTED_MGF: _Reasons
11+
UNSUPPORTED_PUBLIC_KEY_ALGORITHM: _Reasons
12+
UNSUPPORTED_ELLIPTIC_CURVE: _Reasons
13+
UNSUPPORTED_SERIALIZATION: _Reasons
14+
UNSUPPORTED_X509: _Reasons
15+
UNSUPPORTED_EXCHANGE_ALGORITHM: _Reasons
16+
UNSUPPORTED_DIFFIE_HELLMAN: _Reasons
17+
UNSUPPORTED_MAC: _Reasons
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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 cryptography.hazmat.primitives import hashes
6+
from cryptography.hazmat.primitives.asymmetric.types import PrivateKeyTypes
7+
from cryptography.x509 import ocsp
8+
9+
class OCSPRequest: ...
10+
class OCSPResponse: ...
11+
class OCSPSingleResponse: ...
12+
13+
def load_der_ocsp_request(data: bytes) -> ocsp.OCSPRequest: ...
14+
def load_der_ocsp_response(data: bytes) -> ocsp.OCSPResponse: ...
15+
def create_ocsp_request(
16+
builder: ocsp.OCSPRequestBuilder,
17+
) -> ocsp.OCSPRequest: ...
18+
def create_ocsp_response(
19+
status: ocsp.OCSPResponseStatus,
20+
builder: ocsp.OCSPResponseBuilder | None,
21+
private_key: PrivateKeyTypes | None,
22+
hash_algorithm: hashes.HashAlgorithm | None,
23+
) -> ocsp.OCSPResponse: ...
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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 typing
6+
7+
from cryptography.hazmat.bindings._rust.openssl import (
8+
aead,
9+
ciphers,
10+
cmac,
11+
dh,
12+
dsa,
13+
ec,
14+
ed448,
15+
ed25519,
16+
hashes,
17+
hmac,
18+
kdf,
19+
keys,
20+
poly1305,
21+
rsa,
22+
x448,
23+
x25519,
24+
)
25+
26+
__all__ = [
27+
"aead",
28+
"ciphers",
29+
"cmac",
30+
"dh",
31+
"dsa",
32+
"ec",
33+
"ed448",
34+
"ed25519",
35+
"hashes",
36+
"hmac",
37+
"kdf",
38+
"keys",
39+
"openssl_version",
40+
"openssl_version_text",
41+
"poly1305",
42+
"raise_openssl_error",
43+
"rsa",
44+
"x448",
45+
"x25519",
46+
]
47+
48+
CRYPTOGRAPHY_IS_LIBRESSL: bool
49+
CRYPTOGRAPHY_IS_BORINGSSL: bool
50+
CRYPTOGRAPHY_OPENSSL_300_OR_GREATER: bool
51+
CRYPTOGRAPHY_OPENSSL_320_OR_GREATER: bool
52+
53+
class Providers: ...
54+
55+
_legacy_provider_loaded: bool
56+
_providers: Providers
57+
58+
def openssl_version() -> int: ...
59+
def openssl_version_text() -> str: ...
60+
def raise_openssl_error() -> typing.NoReturn: ...
61+
def capture_error_stack() -> list[OpenSSLError]: ...
62+
def is_fips_enabled() -> bool: ...
63+
def enable_fips(providers: Providers) -> None: ...
64+
65+
class OpenSSLError:
66+
@property
67+
def lib(self) -> int: ...
68+
@property
69+
def reason(self) -> int: ...
70+
@property
71+
def reason_text(self) -> bytes: ...
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
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+
class AESGCM:
6+
def __init__(self, key: bytes) -> None: ...
7+
@staticmethod
8+
def generate_key(key_size: int) -> bytes: ...
9+
def encrypt(
10+
self,
11+
nonce: bytes,
12+
data: bytes,
13+
associated_data: bytes | None,
14+
) -> bytes: ...
15+
def decrypt(
16+
self,
17+
nonce: bytes,
18+
data: bytes,
19+
associated_data: bytes | None,
20+
) -> bytes: ...
21+
22+
class ChaCha20Poly1305:
23+
def __init__(self, key: bytes) -> None: ...
24+
@staticmethod
25+
def generate_key() -> bytes: ...
26+
def encrypt(
27+
self,
28+
nonce: bytes,
29+
data: bytes,
30+
associated_data: bytes | None,
31+
) -> bytes: ...
32+
def decrypt(
33+
self,
34+
nonce: bytes,
35+
data: bytes,
36+
associated_data: bytes | None,
37+
) -> bytes: ...
38+
39+
class AESCCM:
40+
def __init__(self, key: bytes, tag_length: int = 16) -> None: ...
41+
@staticmethod
42+
def generate_key(key_size: int) -> bytes: ...
43+
def encrypt(
44+
self,
45+
nonce: bytes,
46+
data: bytes,
47+
associated_data: bytes | None,
48+
) -> bytes: ...
49+
def decrypt(
50+
self,
51+
nonce: bytes,
52+
data: bytes,
53+
associated_data: bytes | None,
54+
) -> bytes: ...
55+
56+
class AESSIV:
57+
def __init__(self, key: bytes) -> None: ...
58+
@staticmethod
59+
def generate_key(key_size: int) -> bytes: ...
60+
def encrypt(
61+
self,
62+
data: bytes,
63+
associated_data: list[bytes] | None,
64+
) -> bytes: ...
65+
def decrypt(
66+
self,
67+
data: bytes,
68+
associated_data: list[bytes] | None,
69+
) -> bytes: ...
70+
71+
class AESOCB3:
72+
def __init__(self, key: bytes) -> None: ...
73+
@staticmethod
74+
def generate_key(key_size: int) -> bytes: ...
75+
def encrypt(
76+
self,
77+
nonce: bytes,
78+
data: bytes,
79+
associated_data: bytes | None,
80+
) -> bytes: ...
81+
def decrypt(
82+
self,
83+
nonce: bytes,
84+
data: bytes,
85+
associated_data: bytes | None,
86+
) -> bytes: ...
87+
88+
class AESGCMSIV:
89+
def __init__(self, key: bytes) -> None: ...
90+
@staticmethod
91+
def generate_key(key_size: int) -> bytes: ...
92+
def encrypt(
93+
self,
94+
nonce: bytes,
95+
data: bytes,
96+
associated_data: bytes | None,
97+
) -> bytes: ...
98+
def decrypt(
99+
self,
100+
nonce: bytes,
101+
data: bytes,
102+
associated_data: bytes | None,
103+
) -> bytes: ...
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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 typing
6+
7+
from cryptography.hazmat.primitives import ciphers
8+
from cryptography.hazmat.primitives.ciphers import modes
9+
10+
@typing.overload
11+
def create_encryption_ctx(
12+
algorithm: ciphers.CipherAlgorithm, mode: modes.ModeWithAuthenticationTag
13+
) -> ciphers.AEADEncryptionContext: ...
14+
@typing.overload
15+
def create_encryption_ctx(
16+
algorithm: ciphers.CipherAlgorithm, mode: modes.Mode
17+
) -> ciphers.CipherContext: ...
18+
@typing.overload
19+
def create_decryption_ctx(
20+
algorithm: ciphers.CipherAlgorithm, mode: modes.ModeWithAuthenticationTag
21+
) -> ciphers.AEADDecryptionContext: ...
22+
@typing.overload
23+
def create_decryption_ctx(
24+
algorithm: ciphers.CipherAlgorithm, mode: modes.Mode
25+
) -> ciphers.CipherContext: ...
26+
def cipher_supported(
27+
algorithm: ciphers.CipherAlgorithm, mode: modes.Mode
28+
) -> bool: ...
29+
def _advance(
30+
ctx: ciphers.AEADEncryptionContext | ciphers.AEADDecryptionContext, n: int
31+
) -> None: ...
32+
def _advance_aad(
33+
ctx: ciphers.AEADEncryptionContext | ciphers.AEADDecryptionContext, n: int
34+
) -> None: ...
35+
36+
class CipherContext: ...
37+
class AEADEncryptionContext: ...
38+
class AEADDecryptionContext: ...

0 commit comments

Comments
 (0)