Struct kpdb::CompositeKey
[−]
[src]
pub struct CompositeKey(_);
Composition of the user's key data.
This data type uses secstr's SecStr
to protect the key data. To
retrieve the protected data use the unsecure
method.
Methods
impl CompositeKey
[src]
fn from_both<S: Into<String>>(password: S, key_file: KeyFile) -> CompositeKey
Create a composite key from both a password and a key file.
Examples
use kpdb::{CompositeKey, KeyFile}; use std::fs::File; let mut file = try!(File::open("database.key")); let key_file = try!(KeyFile::open(&mut file)); let key = CompositeKey::from_both("secret", key_file);
fn from_key_file(key_file: KeyFile) -> CompositeKey
Create a composite key from a key file.
Examples
use kpdb::{CompositeKey, KeyFile}; use std::fs::File; let mut file = try!(File::open("database.key")); let key_file = try!(KeyFile::open(&mut file)); let key = CompositeKey::from_key_file(key_file);
fn from_password<S: Into<String>>(password: S) -> CompositeKey
Create a composite key from a password.
Examples
use kpdb::CompositeKey; let key = CompositeKey::from_password("secret");
fn unsecure(&self) -> [u8; 32]
Gets the protected data from this composite key.
Trait Implementations
impl Clone for CompositeKey
[src]
fn clone(&self) -> CompositeKey
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for CompositeKey
[src]
impl PartialEq for CompositeKey
[src]
fn eq(&self, __arg_0: &CompositeKey) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &CompositeKey) -> bool
This method tests for !=
.