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>
impl<C, PK, SK, M> FileStorage<C, PK, SK, M>
Sourcepub fn new(key_file_path: &Path, crypto: C) -> Self
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.
Sourcepub fn key_file_path(&self) -> &Path
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>
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>
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<C, PK, SK, M> Keystore for FileStorage<C, PK, SK, M>where
C: Crypto,
C::Error: Display + Debug,
C::SecretBox: Serialize + DeserializeOwned,
SK: AsRef<[u8]> + SecretKeyExt<Metadata = M>,
<SK as SecretKeyExt>::Error: Display + Debug,
PK: Clone + From<SK> + Serialize + DeserializeOwned,
M: Clone + Serialize + DeserializeOwned,
impl<C, PK, SK, M> Keystore for FileStorage<C, PK, SK, M>where
C: Crypto,
C::Error: Display + Debug,
C::SecretBox: Serialize + DeserializeOwned,
SK: AsRef<[u8]> + SecretKeyExt<Metadata = M>,
<SK as SecretKeyExt>::Error: Display + Debug,
PK: Clone + From<SK> + Serialize + DeserializeOwned,
M: Clone + Serialize + DeserializeOwned,
type PublicKey = PK
type SecretKey = SK
type Metadata = M
type Error = Error<<C as Crypto>::Error, <SK as SecretKeyExt>::Error>
Source§fn put_key(&mut self, key: Self::SecretKey) -> Result<(), Self::Error>
fn put_key(&mut self, key: Self::SecretKey) -> Result<(), Self::Error>
Securely store secret key
key
in the keystore. Read moreAuto 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>
impl<C, PK, SK, M> Sync for FileStorage<C, PK, SK, M>
impl<C, PK, SK, M> Unpin for FileStorage<C, PK, SK, M>
impl<C, PK, SK, M> UnwindSafe for FileStorage<C, PK, SK, M>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more