| 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) -> bool: ... |
| 14 | |
| 15 | |
| 16 | def new(rsa_key: RsaKey) -> PKCS115_SigScheme: ... |