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§
Sourcefn sign(&self, key: &K, data: &[u8]) -> Result<BinaryData, ProtocolError>
fn sign(&self, key: &K, data: &[u8]) -> Result<BinaryData, ProtocolError>
the public key bytes are only used to look up the private key
Sourcefn sign_create_witness(
&self,
key: &K,
data: &[u8],
) -> Result<AddressWitness, ProtocolError>
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
Sourcefn can_sign_with(&self, key: &K) -> bool
fn can_sign_with(&self, key: &K) -> bool
do we have this identity public key in the signer?