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§
Sourcefn sign(&self, message: &[u8]) -> Result<Vec<u8>, String>
fn sign(&self, message: &[u8]) -> Result<Vec<u8>, String>
Sign the given message and return the raw signature bytes.
Sourcefn clone_box(&self) -> Box<dyn CustomSigner>
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".