pub trait Signer {
    type Error: From<Error> + From<<Self::Keystore as Keystore>::Error>;
    type Keystore: Keystore;

    fn keystore(&self) -> Result<&Self::Keystore, Self::Error>;

    fn id_secret(
        &self,
        id: &<Self::Keystore as Keystore>::KeyId
    ) -> Result<Borrown<'_, SecretKey>, Self::Error> { ... } fn id_public(
        &self,
        id: &<Self::Keystore as Keystore>::KeyId
    ) -> Result<Borrown<'_, PublicKey>, Self::Error> { ... } fn sign(
        &self,
        id: &<Self::Keystore as Keystore>::KeyId,
        message: &Message
    ) -> Result<Signature, Self::Error> { ... } fn sign_with_key(
        &self,
        secret: &SecretKey,
        message: &Message
    ) -> Result<Signature, Self::Error> { ... } }
Expand description

Signature provider based on a keystore

Required Associated Types

Keystore error implementation

Concrete keystore implementation

Required Methods

Accessor to the keystore

Might fail if the keystore is in a corrupt state, not initialized or locked by a concurrent thread.

Provided Methods

Secret key indexed by id.

Public key indexed by id.

Sign a given message with the secret key identified by id

Available on crate feature std only.

Sign a given message with the provided key

Implementors