pub trait Signer: Send + Sync {
// Required methods
fn sign(&self, msg: &[u8]) -> Result<HybridSignature, CryptoError>;
fn verifying_key(&self) -> HybridVerifyingKey;
}Expand description
Produces hybrid signatures over arbitrary bytes and exposes the matching public key.
This is the abstraction the device signing key (DSK) is consumed through. Keeping it
object-safe (&dyn Signer) lets a software key and a Secure Enclave / StrongBox / TPM
backend be used interchangeably at every signing site. Send + Sync so a Box<dyn Signer>
can live inside the (Mutex-shared) Workspace.
Required Methods§
Sourcefn sign(&self, msg: &[u8]) -> Result<HybridSignature, CryptoError>
fn sign(&self, msg: &[u8]) -> Result<HybridSignature, CryptoError>
Sign msg, producing both signature halves (Ed25519 ‖ ML-DSA-65).
Returns CryptoError only for a backend that can fail (hardware); the software
HybridSigningKey implementation is infallible.
Sourcefn verifying_key(&self) -> HybridVerifyingKey
fn verifying_key(&self) -> HybridVerifyingKey
The hybrid public key both halves of sign verify against.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl Signer for HardwareBackedSigner
impl Signer for HybridSigningKey
The software signer: an in-memory hybrid key. Its sign never fails.