Struct kpdb::KeyFile [] [src]

pub struct KeyFile {
    pub key: SecStr,
    pub file_type: KeyFileType,
}

A key file used for encrypting and decrypting the database.

Fields

The key data.

The type of key file.

Methods

impl KeyFile
[src]

[src]

An convenience alias for KeyFile::new_xml().

[src]

Attempts to create a new binary key file.

Examples

use kpdb::KeyFile;

let key = try!(KeyFile::new_binary());

[src]

Attempts to create a new hexadecimal key file.

Examples

use kpdb::KeyFile;

let key = try!(KeyFile::new_hex());

[src]

Attempts to create a new XML key file.

Examples

use kpdb::KeyFile;

let key = try!(KeyFile::new_xml());

[src]

Attempts to open a key file.

Examples

use kpdb::KeyFile;
use std::fs::File;

let mut file = try!(File::open("passwords.key"));
let key = try!(KeyFile::open(&mut file));

[src]

Attempts to save the key file.

Examples

use kpdb::KeyFile;
use std::fs::File;

let key = try!(KeyFile::new());
let mut file = try!(File::create("new.key"));

try!(key.save(&mut file));

Trait Implementations

impl Clone for KeyFile
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for KeyFile
[src]

[src]

Formats the value using the given formatter.

impl PartialEq for KeyFile
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.