FastATP

Signer

A class in fastatp.crypto (source).

Based on Protocol.

Something that signs with a key it may not be able to hand over.

Implement this to put a peer's pen in a TPM, an HSM, a secure element or a remote signing service: sign is awaited so a device that takes tens of milliseconds never stalls the peer's event loop. Return the signature exactly as the device gives it, DER or raw r||s, low-S or not; fastatp normalizes and verifies it (sign_with) before anything is committed, so a misbehaving device fails at the write, not at a mirror.

Curves are k256 and p256 only. TPM 2.0 parts generally offer only p256.

Attributes

Methods

sign

async sign(message: bytes) -> bytes

ECDSA-SHA256 over message, in whatever encoding the device returns.