_PBES.pyi 790 B

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