PKCS1_v1_5.pyi 686 B

1234567891011121314151617181920
  1. from typing import Callable, Union, Any, Optional, TypeVar
  2. from Crypto.PublicKey.RSA import RsaKey
  3. Buffer = Union[bytes, bytearray, memoryview]
  4. T = TypeVar('T')
  5. class PKCS115_Cipher:
  6. def __init__(self,
  7. key: RsaKey,
  8. randfunc: Callable[[int], bytes]) -> None: ...
  9. def can_encrypt(self) -> bool: ...
  10. def can_decrypt(self) -> bool: ...
  11. def encrypt(self, message: Buffer) -> bytes: ...
  12. def decrypt(self, ciphertext: Buffer,
  13. sentinel: T,
  14. expected_pt_len: Optional[int] = ...) -> Union[bytes, T]: ...
  15. def new(key: RsaKey,
  16. randfunc: Optional[Callable[[int], bytes]] = ...) -> PKCS115_Cipher: ...