[][src]Struct kpdb::CompositeKey

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]

pub fn from_both<S: Into<String>>(
    password: S,
    key_file: KeyFile
) -> CompositeKey
[src]

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);

pub fn from_key_file(key_file: KeyFile) -> CompositeKey[src]

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);

pub fn from_password<S: Into<String>>(password: S) -> CompositeKey[src]

Create a composite key from a password.

Examples

use kpdb::CompositeKey;

let key = CompositeKey::from_password("secret");

pub fn unsecure(&self) -> [u8; 32][src]

Gets the protected data from this composite key.

Trait Implementations

impl Clone for CompositeKey[src]

impl Debug for CompositeKey[src]

impl PartialEq<CompositeKey> for CompositeKey[src]

impl StructuralPartialEq for CompositeKey[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.