DSA.pyi 1.3 KB

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