Skip to main content

SignBackend

Trait SignBackend 

Source
pub trait SignBackend: Backend {
    // Required methods
    fn sign(
        &mut self,
        key_id: &KeyId,
        message: &[u8],
        algorithm: SignAlgorithm,
    ) -> Result<Vec<u8>, BackendError>;
    fn verify(
        &self,
        key_id: &KeyId,
        message: &[u8],
        signature: &[u8],
        algorithm: SignAlgorithm,
    ) -> Result<bool, BackendError>;
}
Expand description

Signing and verification operations.

Required Methods§

Source

fn sign( &mut self, key_id: &KeyId, message: &[u8], algorithm: SignAlgorithm, ) -> Result<Vec<u8>, BackendError>

Sign message with key_id using algorithm.

Returns raw signature bytes (format depends on algorithm).

Source

fn verify( &self, key_id: &KeyId, message: &[u8], signature: &[u8], algorithm: SignAlgorithm, ) -> Result<bool, BackendError>

Verify signature over message with key_id and algorithm.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§