Trait Signer

Source
pub trait Signer: Send + Sync {
    // Required methods
    fn sign<'life0, 'life1, 'async_trait>(
        &'life0 self,
        data: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<Signature>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn public_key(&self) -> PublicKey;
    fn is_available(&self) -> bool;
}
Expand description

A signer that can sign arbitrary data

Required Methods§

Source

fn sign<'life0, 'life1, 'async_trait>( &'life0 self, data: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<Signature>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Sign data using a key

Source

fn public_key(&self) -> PublicKey

Get the public key of the signer. Panics if the key is not available.

Source

fn is_available(&self) -> bool

Check if the signer is available

Implementors§