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§
Sourcefn sign(
&mut self,
key_id: &KeyId,
message: &[u8],
algorithm: SignAlgorithm,
) -> Result<Vec<u8>, BackendError>
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).
Sourcefn verify(
&self,
key_id: &KeyId,
message: &[u8],
signature: &[u8],
algorithm: SignAlgorithm,
) -> Result<bool, BackendError>
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".