pub struct EncryptedRootKey { /* private fields */ }
Expand description
Implementations§
Source§impl EncryptedRootKey
impl EncryptedRootKey
Sourcepub fn decrypt(&self, password: &[u8]) -> Result<RootKey, BackendError>
pub fn decrypt(&self, password: &[u8]) -> Result<RootKey, BackendError>
Attempts to decrypt the key with the provided password, and provide it as a RootKey
§Errors
Will return:
Error::Argon2Failure
if the argon2 key derivation failsError::BadHmac
if the hmac verification failed, either due to incorrect password or corruptionError::KeyDeserialization
if the key fails to deserialize, which really shouldn’t happen
Trait Implementations§
Source§impl Clone for EncryptedRootKey
impl Clone for EncryptedRootKey
Source§fn clone(&self) -> EncryptedRootKey
fn clone(&self) -> EncryptedRootKey
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 Debug for EncryptedRootKey
impl Debug for EncryptedRootKey
Source§impl<'de> Deserialize<'de> for EncryptedRootKey
impl<'de> Deserialize<'de> for EncryptedRootKey
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for EncryptedRootKey
impl Hash for EncryptedRootKey
Auto Trait Implementations§
impl Freeze for EncryptedRootKey
impl RefUnwindSafe for EncryptedRootKey
impl Send for EncryptedRootKey
impl Sync for EncryptedRootKey
impl Unpin for EncryptedRootKey
impl UnwindSafe for EncryptedRootKey
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