pkcs1_15.pyi 564 B

1234567891011121314151617
  1. from typing import Optional
  2. from typing_extensions import Protocol
  3. from Crypto.PublicKey.RSA import RsaKey
  4. class Hash(Protocol):
  5. def digest(self) -> bytes: ...
  6. class PKCS115_SigScheme:
  7. def __init__(self, rsa_key: RsaKey) -> None: ...
  8. def can_sign(self) -> bool: ...
  9. def sign(self, msg_hash: Hash) -> bytes: ...
  10. def verify(self, msg_hash: Hash, signature: bytes) -> None: ...
  11. def _EMSA_PKCS1_V1_5_ENCODE(msg_hash: Hash, emLen: int, with_hash_parameters: Optional[bool]=True) -> bytes: ...
  12. def new(rsa_key: RsaKey) -> PKCS115_SigScheme: ...