pub trait Signer: Send {
type Error: Error + Send + Sync + 'static;
// Required methods
fn sign(
&self,
owner: &AccountOwner,
value: &CryptoHash,
) -> impl Future<Output = Result<AccountSignature, Self::Error>> + Send;
fn get_public_key(
&self,
owner: &AccountOwner,
) -> impl Future<Output = Result<AccountPublicKey, Self::Error>> + Send;
fn contains_key(
&self,
owner: &AccountOwner,
) -> impl Future<Output = Result<bool, Self::Error>> + Send;
}
Expand description
A trait for signing keys.
Required Associated Types§
Required Methods§
Sourcefn sign(
&self,
owner: &AccountOwner,
value: &CryptoHash,
) -> impl Future<Output = Result<AccountSignature, Self::Error>> + Send
fn sign( &self, owner: &AccountOwner, value: &CryptoHash, ) -> impl Future<Output = Result<AccountSignature, Self::Error>> + Send
Creates a signature for the given value
using the provided owner
.
Sourcefn get_public_key(
&self,
owner: &AccountOwner,
) -> impl Future<Output = Result<AccountPublicKey, Self::Error>> + Send
fn get_public_key( &self, owner: &AccountOwner, ) -> impl Future<Output = Result<AccountPublicKey, Self::Error>> + Send
Returns the public key corresponding to the given owner
.
Sourcefn contains_key(
&self,
owner: &AccountOwner,
) -> impl Future<Output = Result<bool, Self::Error>> + Send
fn contains_key( &self, owner: &AccountOwner, ) -> impl Future<Output = Result<bool, Self::Error>> + Send
Returns whether the given owner
is a known signer.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.