Crate keepass_db

Source
Expand description

Read, modify and write KeePass 2.x databases

The main types used in this crate are:

  • Key which represents the composite key used to lock a database
  • KeePassDoc which represents the contents of an unlocked KeePass database

§Opening a database:

use std::io::Error;
use keepass_db::{KeePassDoc, protected_stream::CipherValue, Key};
fn main() -> Result<(), Error> {
    let mut key = Key::new();
    key.set_user_password("asdf");
    let mut doc = KeePassDoc::load_file("testdata/dummy-kdbx41.kdbx", &key)?;
    let database = doc.file;
    let stream = &mut doc.cipher;
    let basic_entry = database.root_group().all_entries().filter(|e| e.url().unprotect(stream).unwrap() == "https://keepass.info/").last().unwrap();
    println!("Password: {}", basic_entry.password().unprotect(stream).unwrap());
    Ok(())
}

Modules§

protected_stream

Structs§

AesKdf
DeletedObject
Entry
Password entry
EntryIter
Iterator over password Entry
Group
Group of password entries and subgroups
GroupIter
Item
KeePassDoc
A KeePass database
KeePassFile
Testing doc macros
Key
Composite key protecting the password database
Root
Times
Various times about password or group item

Enums§

ElementEvent
MapValue
ProtectedValue

Constants§

KDF_AES_KDBX3
KDF_PARAM_ITERATIONS
KDF_PARAM_MEMORY
KDF_PARAM_PARALLELISM
KDF_PARAM_ROUNDS
KDF_PARAM_SALT
KDF_PARAM_UUID
KDF_PARAM_VERSION

Traits§

Kdf

Functions§

transform_aes_kdf
transform_argon2