Trait fuel_crypto::Keystore

source ·
pub trait Keystore {
    type Error: From<Error>;
    type KeyId;

    // Required method
    fn secret(
        &self,
        id: &Self::KeyId
    ) -> Result<Option<Borrown<'_, SecretKey>>, Self::Error>;

    // Provided method
    fn public(
        &self,
        id: &Self::KeyId
    ) -> Result<Option<Borrown<'_, PublicKey>>, Self::Error> { ... }
}
Expand description

Keys container

Required Associated Types§

source

type Error: From<Error>

Keystore error implementation

source

type KeyId

Identifier for the keypair

Required Methods§

source

fn secret( &self, id: &Self::KeyId ) -> Result<Option<Borrown<'_, SecretKey>>, Self::Error>

Secret key for a given id

Provided Methods§

source

fn public( &self, id: &Self::KeyId ) -> Result<Option<Borrown<'_, PublicKey>>, Self::Error>

Available on crate feature std only.

Public key for a given id

Implementors§