Struct kpdb::CompositeKey
source · [−]pub struct CompositeKey(_);
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
sourceimpl 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
sourceimpl Clone for CompositeKey
impl Clone for CompositeKey
sourcefn clone(&self) -> CompositeKey
fn clone(&self) -> CompositeKey
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for CompositeKey
impl Debug for CompositeKey
sourceimpl PartialEq<CompositeKey> for CompositeKey
impl PartialEq<CompositeKey> for CompositeKey
sourcefn eq(&self, other: &CompositeKey) -> bool
fn eq(&self, other: &CompositeKey) -> bool
impl StructuralPartialEq for CompositeKey
Auto Trait Implementations
impl RefUnwindSafe for CompositeKey
impl Send for CompositeKey
impl Sync for CompositeKey
impl Unpin for CompositeKey
impl UnwindSafe for CompositeKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more