Struct asuran::repository::EncryptedKey [−][src]
pub struct EncryptedKey { /* fields omitted */ }
Expand description
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
pub fn encrypt(
key: &Key,
mem_cost: u32,
time_cost: u32,
encryption: Encryption,
user_key: &[u8]
) -> EncryptedKey
pub fn encrypt(
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
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
Trait Implementations
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<EncryptedKey, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<EncryptedKey, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more