aboutsummaryrefslogtreecommitdiff
path: root/frozen_deps/Cryptodome/PublicKey/RSA.pyi
diff options
context:
space:
mode:
Diffstat (limited to 'frozen_deps/Cryptodome/PublicKey/RSA.pyi')
-rw-r--r--frozen_deps/Cryptodome/PublicKey/RSA.pyi41
1 files changed, 34 insertions, 7 deletions
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: ...