Skip to main content

Signer

Trait Signer 

Source
pub trait Signer<K>:
    Send
    + Sync
    + Debug {
    // Required methods
    fn sign<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        key: &'life1 K,
        data: &'life2 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<BinaryData, ProtocolError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn sign_create_witness<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        key: &'life1 K,
        data: &'life2 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<AddressWitness, ProtocolError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn can_sign_with(&self, key: &K) -> bool;
}

Required Methods§

Source

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

the public key bytes are only used to look up the private key

Source

fn sign_create_witness<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, key: &'life1 K, data: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = Result<AddressWitness, ProtocolError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

the public key bytes are only used to look up the private key

Source

fn can_sign_with(&self, key: &K) -> bool

do we have this identity public key in the signer?

Implementations on Foreign Types§

Source§

impl<K, S> Signer<K> for Arc<S>
where K: Send + Sync, S: Signer<K> + ?Sized + Send + Sync,

Source§

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

Source§

fn sign_create_witness<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, key: &'life1 K, data: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = Result<AddressWitness, ProtocolError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn can_sign_with(&self, key: &K) -> bool

Implementors§