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