Signer

Trait Signer 

Source
pub trait Signer<K>: Sync + Debug {
    // Required methods
    fn sign(&self, key: &K, data: &[u8]) -> Result<BinaryData, ProtocolError>;
    fn sign_create_witness(
        &self,
        key: &K,
        data: &[u8],
    ) -> Result<AddressWitness, ProtocolError>;
    fn can_sign_with(&self, key: &K) -> bool;
}

Required Methods§

Source

fn sign(&self, key: &K, data: &[u8]) -> Result<BinaryData, ProtocolError>

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

Source

fn sign_create_witness( &self, key: &K, data: &[u8], ) -> Result<AddressWitness, ProtocolError>

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 S: Signer<K> + ?Sized + Send,

Source§

fn sign(&self, key: &K, data: &[u8]) -> Result<BinaryData, ProtocolError>

Source§

fn sign_create_witness( &self, key: &K, data: &[u8], ) -> Result<AddressWitness, ProtocolError>

Source§

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

Implementors§