Struct MemoryStorage

Source
pub struct MemoryStorage<C: Crypto, PK, SK, M> { /* private fields */ }
Expand description

Keystore implementation which stores the encrypted key in memory.

This is provided mainly for testing in environments where hitting the filesystem is undesirable, and otherwise equivalent to FileStorage.

Implementations§

Source§

impl<C: Crypto, PK, SK, M> MemoryStorage<C, PK, SK, M>

Source

pub fn new(crypto: C) -> Self

Trait Implementations§

Source§

impl<C, PK, SK, M> Keystore for MemoryStorage<C, PK, SK, M>
where C: Crypto, C::Error: Display + Debug, C::SecretBox: Clone, SK: AsRef<[u8]> + SecretKeyExt<Metadata = M>, <SK as SecretKeyExt>::Error: Display + Debug, PK: Clone + From<SK>, M: Clone,

Source§

type PublicKey = PK

Source§

type SecretKey = SK

Source§

type Metadata = M

Source§

type Error = Error<<C as Crypto>::Error, <SK as SecretKeyExt>::Error>

Source§

fn put_key(&mut self, key: Self::SecretKey) -> Result<(), Self::Error>

Securely store secret key key in the keystore. Read more
Source§

fn get_key( &self, ) -> Result<Keypair<Self::PublicKey, Self::SecretKey>, Self::Error>

Retrieve both the secret and public parts of the stored key material.
Source§

fn show_key(&self) -> Result<(Self::PublicKey, Self::Metadata), Self::Error>

Retrieve only the public part of the key material, along with any metadata.

Auto Trait Implementations§

§

impl<C, PK, SK, M> Freeze for MemoryStorage<C, PK, SK, M>
where C: Freeze, PK: Freeze, <C as Crypto>::SecretBox: Freeze, M: Freeze,

§

impl<C, PK, SK, M> RefUnwindSafe for MemoryStorage<C, PK, SK, M>

§

impl<C, PK, SK, M> Send for MemoryStorage<C, PK, SK, M>
where C: Send, SK: Send, PK: Send, <C as Crypto>::SecretBox: Send, M: Send,

§

impl<C, PK, SK, M> Sync for MemoryStorage<C, PK, SK, M>
where C: Sync, SK: Sync, PK: Sync, <C as Crypto>::SecretBox: Sync, M: Sync,

§

impl<C, PK, SK, M> Unpin for MemoryStorage<C, PK, SK, M>
where C: Unpin, SK: Unpin, PK: Unpin, <C as Crypto>::SecretBox: Unpin, M: Unpin,

§

impl<C, PK, SK, M> UnwindSafe for MemoryStorage<C, PK, SK, M>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V