_PBES.pyi 755 B

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