Skip to main content

CustomSigner

Trait CustomSigner 

Source
pub trait CustomSigner:
    Send
    + Sync
    + Debug {
    // Required methods
    fn sign(&self, message: &[u8]) -> Result<Vec<u8>, String>;
    fn clone_box(&self) -> Box<dyn CustomSigner>;
}
Expand description

Trait for delegating signing to an external service (e.g., HSM, TPM, cloud KMS).

Implementations must be thread-safe and cloneable. Each DTLS handshake may clone the signer, so clone_box must return a fresh instance that signs with the same key.

Required Methods§

Source

fn sign(&self, message: &[u8]) -> Result<Vec<u8>, String>

Sign the given message and return the raw signature bytes.

Source

fn clone_box(&self) -> Box<dyn CustomSigner>

Clone this signer into a new boxed instance.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§