| 1 | from typing import Optional, Callable, TypedDict |
| 2 | from typing_extensions import NotRequired |
| 3 | |
| 4 | class PbesError(ValueError): |
| 5 | ... |
| 6 | |
| 7 | class PBES1(object): |
| 8 | @staticmethod |
| 9 | def decrypt(data: bytes, passphrase: bytes) -> bytes: ... |
| 10 | |
| 11 | class ProtParams(TypedDict): |
| 12 | iteration_count: NotRequired[int] |
| 13 | salt_size: NotRequired[int] |
| 14 | block_size: NotRequired[int] |
| 15 | parallelization: NotRequired[int] |
| 16 | |
| 17 | class PBES2(object): |
| 18 | @staticmethod |
| 19 | def encrypt(data: bytes, |
| 20 | passphrase: bytes, |
| 21 | protection: str, |
| 22 | prot_params: Optional[ProtParams] = ..., |
| 23 | randfunc: Optional[Callable[[int],bytes]] = ...) -> bytes: ... |
| 24 | |
| 25 | @staticmethod |
| 26 | def decrypt(data:bytes, passphrase: bytes) -> bytes: ... |