From 8d1c76ec7caf247d5675e14260d20fc508977ffb Mon Sep 17 00:00:00 2001 From: Determinant Date: Fri, 23 Aug 2024 03:14:03 +0000 Subject: release v0.1.8 --- frozen_deps/Cryptodome/PublicKey/RSA.pyi | 41 ++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 7 deletions(-) (limited to 'frozen_deps/Cryptodome/PublicKey/RSA.pyi') diff --git a/frozen_deps/Cryptodome/PublicKey/RSA.pyi b/frozen_deps/Cryptodome/PublicKey/RSA.pyi index d436acf..85f6c4a 100644 --- a/frozen_deps/Cryptodome/PublicKey/RSA.pyi +++ b/frozen_deps/Cryptodome/PublicKey/RSA.pyi @@ -1,4 +1,7 @@ -from typing import Callable, Union, Tuple, Optional +from typing import Callable, Union, Tuple, Optional, overload, Literal + +from Cryptodome.Math.Numbers import Integer +from Cryptodome.IO._PBES import ProtParams __all__ = ['generate', 'construct', 'import_key', 'RsaKey', 'oid'] @@ -7,6 +10,7 @@ RNG = Callable[[int], bytes] class RsaKey(object): def __init__(self, **kwargs: int) -> None: ... + @property def n(self) -> int: ... @property @@ -19,6 +23,11 @@ class RsaKey(object): def q(self) -> int: ... @property def u(self) -> int: ... + @property + def invp(self) -> int: ... + @property + def invq(self) -> int: ... + def size_in_bits(self) -> int: ... def size_in_bytes(self) -> int: ... def has_private(self) -> bool: ... @@ -30,18 +39,36 @@ class RsaKey(object): def __getstate__(self) -> None: ... def __repr__(self) -> str: ... def __str__(self) -> str: ... - def export_key(self, format: Optional[str]="PEM", passphrase: Optional[str]=None, pkcs: Optional[int]=1, - protection: Optional[str]=None, randfunc: Optional[RNG]=None) -> bytes: ... + + @overload + def export_key(self, + format: Optional[str]="PEM", + passphrase: Optional[str]=None, + pkcs: Optional[int]=1, + protection: Optional[str]=None, + randfunc: Optional[RNG]=None + ) -> bytes: ... + @overload + def export_key(self, *, + format: Optional[str]="PEM", + passphrase: str, + pkcs: Literal[8], + protection: str, + randfunc: Optional[RNG]=None, + prot_params: ProtParams, + ) -> bytes: ... # Backward compatibility exportKey = export_key publickey = public_key +Int = Union[int, Integer] + def generate(bits: int, randfunc: Optional[RNG]=None, e: Optional[int]=65537) -> RsaKey: ... -def construct(rsa_components: Union[Tuple[int, int], # n, e - Tuple[int, int, int], # n, e, d - Tuple[int, int, int, int, int], # n, e, d, p, q - Tuple[int, int, int, int, int, int]], # n, e, d, p, q, crt_q +def construct(rsa_components: Union[Tuple[Int, Int], # n, e + Tuple[Int, Int, Int], # n, e, d + Tuple[Int, Int, Int, Int, Int], # n, e, d, p, q + Tuple[Int, Int, Int, Int, Int, Int]], # n, e, d, p, q, crt_q consistency_check: Optional[bool]=True) -> RsaKey: ... def import_key(extern_key: Union[str, bytes], passphrase: Optional[str]=None) -> RsaKey: ... -- cgit v1.2.3-70-g09d2