Skip to main content

Signer

Trait Signer 

Source
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§

Source

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.

Source

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§

Source§

impl Signer for HardwareBackedSigner

Source§

impl Signer for HybridSigningKey

The software signer: an in-memory hybrid key. Its sign never fails.

Source§

impl Signer for P256HybridSigningKey