Skip to main content

GenerateSignature

Trait GenerateSignature 

Source
pub trait GenerateSignature {
    // Required method
    fn generate_signature(
        &self,
        algorithm: Algorithm,
        msg: &[u8],
    ) -> Result<Vec<u8>, ImplementationError>;
}
Expand description

Trait that provides interface to generate signatures given a message and an algorithm. This is implemented for Vec<u8> and friends as a batteries-included way to generate signatures from raw key material, but can be implemented for any type of client-controlled signer as well (yubikey, cloud kms, web3 wallet, etc).

Required Methods§

Source

fn generate_signature( &self, algorithm: Algorithm, msg: &[u8], ) -> Result<Vec<u8>, ImplementationError>

Generate signature given the algorithm and the message to sign.

Implementations on Foreign Types§

Source§

impl GenerateSignature for Vec<u8>

Source§

fn generate_signature( &self, algorithm: Algorithm, msg: &[u8], ) -> Result<Vec<u8>, ImplementationError>

Source§

impl GenerateSignature for [u8; 32]

Source§

fn generate_signature( &self, algorithm: Algorithm, msg: &[u8], ) -> Result<Vec<u8>, ImplementationError>

Source§

impl GenerateSignature for [u8]

Source§

fn generate_signature( &self, algorithm: Algorithm, msg: &[u8], ) -> Result<Vec<u8>, ImplementationError>

Implementors§