[−][src]Struct asuran_core::repository::key::EncryptedKey
Stores the key, encrypted with another key derived from the user specified password/passphrase
Uses argon2 to derive the key encryption key from the user supplied key.
Uses a 32 byte salt that is randomly generated
Currently uses semi-arbitrary defaults for some values. TODO: allow configuration of this
Implementations
impl EncryptedKey
[src]
pub fn encrypt(
key: &Key,
mem_cost: u32,
time_cost: u32,
encryption: Encryption,
user_key: &[u8]
) -> EncryptedKey
[src]
key: &Key,
mem_cost: u32,
time_cost: u32,
encryption: Encryption,
user_key: &[u8]
) -> EncryptedKey
Produces an encrypted key from the specified user key and encryption method
pub fn encrypt_defaults(
key: &Key,
encryption: Encryption,
user_key: &[u8]
) -> EncryptedKey
[src]
key: &Key,
encryption: Encryption,
user_key: &[u8]
) -> EncryptedKey
Convince function that uses argon2 parameters that the author of this program believes are reasonable as of time of writing. Please review them and apply your own common sense before blaming the author for the FBI reading your data.
Parameters are:
mem_cost
: 65536time_cost
: 10
pub fn decrypt(&self, user_key: &[u8]) -> Result<Key, KeyError>
[src]
Attempts to decrypt the key material using the user supplied key.
Errors:
Will return Err(KeyError)
if key decryption fails
Trait Implementations
impl Clone for EncryptedKey
[src]
fn clone(&self) -> EncryptedKey
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for EncryptedKey
[src]
impl<'de> Deserialize<'de> for EncryptedKey
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for EncryptedKey
[src]
Auto Trait Implementations
impl RefUnwindSafe for EncryptedKey
impl Send for EncryptedKey
impl Sync for EncryptedKey
impl Unpin for EncryptedKey
impl UnwindSafe for EncryptedKey
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,