DSA.pyi 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. from typing import Dict, Tuple, Callable, Union, Optional
  2. __all__ = ['generate', 'construct', 'DsaKey', 'import_key' ]
  3. RNG = Callable[[int], bytes]
  4. class DsaKey(object):
  5. def __init__(self, key_dict: Dict[str, int]) -> None: ...
  6. def has_private(self) -> bool: ...
  7. def can_encrypt(self) -> bool: ... # legacy
  8. def can_sign(self) -> bool: ... # legacy
  9. def public_key(self) -> DsaKey: ...
  10. def __eq__(self, other: object) -> bool: ...
  11. def __ne__(self, other: object) -> bool: ...
  12. def __getstate__(self) -> None: ...
  13. def domain(self) -> Tuple[int, int, int]: ...
  14. def __repr__(self) -> str: ...
  15. def __getattr__(self, item: str) -> int: ...
  16. def export_key(self, format: Optional[str]="PEM", pkcs8: Optional[bool]=None, passphrase: Optional[str]=None,
  17. protection: Optional[str]=None, randfunc: Optional[RNG]=None) -> bytes: ...
  18. # Backward-compatibility
  19. exportKey = export_key
  20. publickey = public_key
  21. def generate(bits: int, randfunc: Optional[RNG]=None, domain: Optional[Tuple[int, int, int]]=None) -> DsaKey: ...
  22. def construct(tup: Union[Tuple[int, int, int, int], Tuple[int, int, int, int, int]], consistency_check: Optional[bool]=True) -> DsaKey: ...
  23. def import_key(extern_key: Union[str, bytes], passphrase: Optional[str]=None) -> DsaKey: ...
  24. # Backward compatibility
  25. importKey = import_key
  26. oid: str