Struct FileStorage

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

Keystore implementation which stores the encrypted key in a file on the local filesystem.

Implementations§

Source§

impl<C, PK, SK, M> FileStorage<C, PK, SK, M>

Source

pub fn new(key_file_path: &Path, crypto: C) -> Self

Construct a new FileStorage with the given Crypto implementation.

The Path given by key_file_path must be an actual file path, not a directory.

Source

pub fn key_file_path(&self) -> &Path

Path to the file where the encrypted key is stored.

Trait Implementations§

Source§

impl<C: Clone, PK: Clone, SK: Clone, M: Clone> Clone for FileStorage<C, PK, SK, M>

Source§

fn clone(&self) -> FileStorage<C, PK, SK, M>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<C, PK, SK, M> Keystore for FileStorage<C, PK, SK, M>

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 FileStorage<C, PK, SK, M>
where C: Freeze,

§

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

§

impl<C, PK, SK, M> Send for FileStorage<C, PK, SK, M>
where C: Send, PK: Send, SK: Send, M: Send,

§

impl<C, PK, SK, M> Sync for FileStorage<C, PK, SK, M>
where C: Sync, PK: Sync, SK: Sync, M: Sync,

§

impl<C, PK, SK, M> Unpin for FileStorage<C, PK, SK, M>
where C: Unpin, PK: Unpin, SK: Unpin, M: Unpin,

§

impl<C, PK, SK, M> UnwindSafe for FileStorage<C, PK, SK, M>
where C: UnwindSafe, PK: UnwindSafe, SK: UnwindSafe, M: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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