Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 25 additions & 22 deletions stubs/python-jose/jose/backends/cryptography_backend.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Any, ClassVar
from typing_extensions import Self

from . import get_random_bytes as get_random_bytes
from .base import Key
Expand All @@ -13,12 +14,12 @@ class CryptographyECKey(Key):
cryptography_backend: Any
prepared_key: Any
def __init__(self, key, algorithm, cryptography_backend=...) -> None: ...
def sign(self, msg): ...
def verify(self, msg, sig): ...
def is_public(self): ...
def public_key(self): ...
def to_pem(self): ...
def to_dict(self): ...
def sign(self, msg: bytes) -> bytes: ...
def verify(self, msg: bytes, sig: bytes) -> bool: ...
def is_public(self) -> bool: ...
def public_key(self) -> Self: ...
def to_pem(self) -> bytes: ...
def to_dict(self) -> dict[str, Any]: ...

class CryptographyRSAKey(Key):
SHA256: Any
Expand All @@ -32,14 +33,14 @@ class CryptographyRSAKey(Key):
cryptography_backend: Any
prepared_key: Any
def __init__(self, key, algorithm, cryptography_backend=...) -> None: ...
def sign(self, msg): ...
def verify(self, msg, sig): ...
def is_public(self): ...
def public_key(self): ...
def to_pem(self, pem_format: str = "PKCS8"): ...
def to_dict(self): ...
def wrap_key(self, key_data): ...
def unwrap_key(self, wrapped_key): ...
def sign(self, msg: bytes) -> bytes: ...
def verify(self, msg: bytes, sig: bytes) -> bool: ...
def is_public(self) -> bool: ...
def public_key(self) -> Self: ...
def to_pem(self, pem_format: str = "PKCS8") -> bytes: ...
def to_dict(self) -> dict[str, Any]: ...
def wrap_key(self, key_data: bytes) -> bytes: ...
def unwrap_key(self, wrapped_key: bytes) -> bytes: ...

class CryptographyAESKey(Key):
KEY_128: Any
Expand All @@ -51,16 +52,18 @@ class CryptographyAESKey(Key):
MODES: Any
IV_BYTE_LENGTH_MODE_MAP: ClassVar[dict[str, int]]
def __init__(self, key, algorithm) -> None: ...
def to_dict(self): ...
def encrypt(self, plain_text, aad=None): ...
def decrypt(self, cipher_text, iv=None, aad=None, tag=None): ...
def wrap_key(self, key_data): ...
def unwrap_key(self, wrapped_key): ...
def to_dict(self) -> dict[str, Any]: ...
def encrypt(self, plain_text: str | bytes, aad: bytes | None = None) -> tuple[bytes, bytes, bytes | None]: ...
def decrypt(
self, cipher_text: str | bytes, iv: str | bytes | None = None, aad: bytes | None = None, tag: bytes | None = None
) -> bytes: ...
def wrap_key(self, key_data: bytes) -> bytes: ...
def unwrap_key(self, wrapped_key: bytes) -> bytes: ...

class CryptographyHMACKey(Key):
ALG_MAP: Any
prepared_key: Any
def __init__(self, key, algorithm) -> None: ...
def to_dict(self): ...
def sign(self, msg): ...
def verify(self, msg, sig): ...
def to_dict(self) -> dict[str, Any]: ...
def sign(self, msg: bytes) -> bytes: ...
def verify(self, msg: bytes, sig: bytes) -> bool: ...
Loading