Struct sc_keystore::Store[][src]

pub struct Store { /* fields omitted */ }

Key store.

Stores key pairs in a file system store + short lived key pairs in memory.

Every pair that is being generated by a seed, will be placed in memory.

Implementations

impl Store[src]

pub fn open<T: Into<PathBuf>>(
    path: T,
    password: Option<SecretString>
) -> Result<KeyStorePtr>
[src]

Open the store at the given path.

Optionally takes a password that will be used to encrypt/decrypt the keys.

pub fn new_in_memory() -> KeyStorePtr[src]

Create a new in-memory store.

pub fn insert_by_type<Pair: PairT>(
    &self,
    key_type: KeyTypeId,
    suri: &str
) -> Result<Pair>
[src]

Insert a new key.

Places it into the file system store.

pub fn insert<Pair: AppPair>(&self, suri: &str) -> Result<Pair>[src]

Insert a new key.

Places it into the file system store.

pub fn generate_by_type<Pair: PairT>(&self, key_type: KeyTypeId) -> Result<Pair>[src]

Generate a new key.

Places it into the file system store.

pub fn generate<Pair: AppPair>(&self) -> Result<Pair>[src]

Generate a new key.

Places it into the file system store.

pub fn insert_ephemeral_from_seed_by_type<Pair: PairT>(
    &mut self,
    seed: &str,
    key_type: KeyTypeId
) -> Result<Pair>
[src]

Create a new key from seed.

Does not place it into the file system store.

pub fn insert_ephemeral_from_seed<Pair: AppPair>(
    &mut self,
    seed: &str
) -> Result<Pair>
[src]

Create a new key from seed.

Does not place it into the file system store.

pub fn key_pair_by_type<Pair: PairT>(
    &self,
    public: &Pair::Public,
    key_type: KeyTypeId
) -> Result<Pair>
[src]

Get a key pair for the given public key and key type.

pub fn key_pair<Pair: AppPair>(
    &self,
    public: &<Pair as AppKey>::Public
) -> Result<Pair>
[src]

Get a key pair for the given public key.

pub fn public_keys<Public: AppPublic>(&self) -> Result<Vec<Public>>[src]

Get public keys of all stored keys that match the key type.

This will just use the type of the public key (a list of which to be returned) in order to determine the key type. Unless you use a specialized application-type public key, then this only give you keys registered under generic cryptography, and will not return keys registered under the application type.

Trait Implementations

impl BareCryptoStore for Store[src]

Auto Trait Implementations

impl RefUnwindSafe for Store

impl Send for Store

impl Sync for Store

impl Unpin for Store

impl UnwindSafe for Store

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, Outer> IsWrappedBy<Outer> for T where
    T: From<Outer>,
    Outer: AsRef<T> + AsMut<T> + From<T>, 
[src]

pub fn from_ref(outer: &Outer) -> &T[src]

Get a reference to the inner from the outer.

pub fn from_mut(outer: &mut Outer) -> &mut T[src]

Get a mutable reference to the inner from the outer.

impl<T> MaybeRefUnwindSafe for T where
    T: RefUnwindSafe
[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]