Crate keepass[][src]

Expand description

keepass: KeePass .kdbx database file parser for Rust

extern crate keepass;

use keepass::{Database, NodeRef, Result, Error};
use std::fs::File;

fn main() -> Result<()> {
    // Open KeePass database
    let path = std::path::Path::new("tests/resources/test_db_with_password.kdbx");
    let db = Database::open(&mut File::open(path)?, Some("demopass"), None)?;

    // Iterate over all Groups and Nodes
    for node in &db.root {
        match node {
            NodeRef::Group(g) => {
                println!("Saw group '{0}'",;
            NodeRef::Entry(e) => {
                let title = e.get_title().unwrap();
                let user = e.get_username().unwrap();
                let pass = e.get_password().unwrap();
                println!("Entry '{0}': '{1}' : '{2}'", title, user, pass);



pub use self::result::CryptoError;
pub use self::result::DatabaseIntegrityError;
pub use self::result::Error;
pub use self::result::Result;



An AutoType setting associated with an Entry

A window association associated with an AutoType setting

A decrypted KeePass database

A database entry containing several key-value fields.

A database group with child groups and entries

An iterator over Groups and Entries