pub struct CompositeKey(/* private fields */);Expand description
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.
Implementations§
Source§impl CompositeKey
impl CompositeKey
Sourcepub fn from_both<S: Into<String>>(
password: S,
key_file: KeyFile,
) -> CompositeKey
pub 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 = File::open("database.key")?;
let key_file = KeyFile::open(&mut file)?;
let key = CompositeKey::from_both("secret", key_file);Sourcepub fn from_key_file(key_file: KeyFile) -> CompositeKey
pub 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 = File::open("database.key")?;
let key_file = KeyFile::open(&mut file)?;
let key = CompositeKey::from_key_file(key_file);Sourcepub fn from_password<S: Into<String>>(password: S) -> CompositeKey
pub 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");Trait Implementations§
Source§impl Clone for CompositeKey
impl Clone for CompositeKey
Source§fn clone(&self) -> CompositeKey
fn clone(&self) -> CompositeKey
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 CompositeKey
impl Debug for CompositeKey
Source§impl PartialEq for CompositeKey
impl PartialEq for CompositeKey
impl StructuralPartialEq for CompositeKey
Auto Trait Implementations§
impl Freeze for CompositeKey
impl RefUnwindSafe for CompositeKey
impl Send for CompositeKey
impl Sync for CompositeKey
impl Unpin for CompositeKey
impl UnwindSafe for CompositeKey
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