[][src]Trait sp_core::traits::BareCryptoStore

pub trait BareCryptoStore: Send + Sync {
    fn sr25519_public_keys(&self, id: KeyTypeId) -> Vec<Public>;
fn sr25519_generate_new(
        &mut self,
        id: KeyTypeId,
        seed: Option<&str>
    ) -> Result<Public, String>;
fn sr25519_key_pair(&self, id: KeyTypeId, pub_key: &Public) -> Option<Pair>;
fn ed25519_public_keys(&self, id: KeyTypeId) -> Vec<Public>;
fn ed25519_generate_new(
        &mut self,
        id: KeyTypeId,
        seed: Option<&str>
    ) -> Result<Public, String>;
fn ed25519_key_pair(&self, id: KeyTypeId, pub_key: &Public) -> Option<Pair>;
fn insert_unknown(
        &mut self,
        _key_type: KeyTypeId,
        _suri: &str,
        _public: &[u8]
    ) -> Result<(), ()>;
fn password(&self) -> Option<&str>; }

Something that generates, stores and provides access to keys.

Required methods

fn sr25519_public_keys(&self, id: KeyTypeId) -> Vec<Public>

Returns all sr25519 public keys for the given key type.

fn sr25519_generate_new(
    &mut self,
    id: KeyTypeId,
    seed: Option<&str>
) -> Result<Public, String>

Generate a new sr25519 key pair for the given key type and an optional seed.

If the given seed is Some(_), the key pair will only be stored in memory.

Returns the public key of the generated key pair.

fn sr25519_key_pair(&self, id: KeyTypeId, pub_key: &Public) -> Option<Pair>

Returns the sr25519 key pair for the given key type and public key combination.

fn ed25519_public_keys(&self, id: KeyTypeId) -> Vec<Public>

Returns all ed25519 public keys for the given key type.

fn ed25519_generate_new(
    &mut self,
    id: KeyTypeId,
    seed: Option<&str>
) -> Result<Public, String>

Generate a new ed25519 key pair for the given key type and an optional seed.

If the given seed is Some(_), the key pair will only be stored in memory.

Returns the public key of the generated key pair.

fn ed25519_key_pair(&self, id: KeyTypeId, pub_key: &Public) -> Option<Pair>

Returns the ed25519 key pair for the given key type and public key combination.

fn insert_unknown(
    &mut self,
    _key_type: KeyTypeId,
    _suri: &str,
    _public: &[u8]
) -> Result<(), ()>

Insert a new key. This doesn't require any known of the crypto; but a public key must be manually provided.

Places it into the file system store.

Err if there's some sort of weird filesystem error, but should generally be Ok.

fn password(&self) -> Option<&str>

Get the password for this store.

Loading content...

Implementors

impl BareCryptoStore for KeyStore[src]

Loading content...