Struct radicle_keystore::file::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
sourceimpl<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
sourceimpl<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>
sourcefn clone(&self) -> FileStorage<C, PK, SK, M>
fn clone(&self) -> FileStorage<C, PK, SK, M>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<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::Error, <SK as SecretKeyExt>::Error>
sourcefn 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 more
Auto Trait Implementations
impl<C, PK, SK, M> RefUnwindSafe for FileStorage<C, PK, SK, M> where
C: RefUnwindSafe,
M: RefUnwindSafe,
PK: RefUnwindSafe,
SK: RefUnwindSafe,
impl<C, PK, SK, M> Send for FileStorage<C, PK, SK, M> where
C: Send,
M: Send,
PK: Send,
SK: Send,
impl<C, PK, SK, M> Sync for FileStorage<C, PK, SK, M> where
C: Sync,
M: Sync,
PK: Sync,
SK: Sync,
impl<C, PK, SK, M> Unpin for FileStorage<C, PK, SK, M> where
C: Unpin,
M: Unpin,
PK: Unpin,
SK: Unpin,
impl<C, PK, SK, M> UnwindSafe for FileStorage<C, PK, SK, M> where
C: UnwindSafe,
M: UnwindSafe,
PK: UnwindSafe,
SK: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more