2018-09-30 02:30:33 +02:00
|
|
|
from typing import Callable, Union, Any, Optional
|
|
|
|
|
|
|
|
|
|
from Crypto.PublicKey.RSA import RsaKey
|
|
|
|
|
|
2018-11-18 22:43:56 +01:00
|
|
|
Buffer = Union[bytes, bytearray, memoryview]
|
2018-09-30 02:30:33 +02:00
|
|
|
|
|
|
|
|
class PKCS115_Cipher:
|
2018-11-18 22:43:56 +01:00
|
|
|
def __init__(self,
|
|
|
|
|
key: RsaKey,
|
|
|
|
|
randfunc: Callable[[int], bytes]) -> None: ...
|
2018-09-30 02:30:33 +02:00
|
|
|
def can_encrypt(self) -> bool: ...
|
|
|
|
|
def can_decrypt(self) -> bool: ...
|
2018-11-18 22:43:56 +01:00
|
|
|
def encrypt(self, message: Buffer) -> bytes: ...
|
|
|
|
|
def decrypt(self, ciphertext: Buffer) -> bytes: ...
|
2018-09-30 02:30:33 +02:00
|
|
|
|
2018-11-18 22:43:56 +01:00
|
|
|
def new(key: Buffer,
|
|
|
|
|
randfunc: Optional[Callable[[int], bytes]] = ...) -> PKCS115_Cipher: ...
|