7 releases
0.3.3 | Sep 29, 2024 |
---|---|
0.3.2 | Oct 9, 2023 |
0.3.1 | Aug 13, 2023 |
0.2.4 | Aug 13, 2023 |
0.1.0 | Jul 23, 2023 |
#224 in Authentication
35KB
668 lines
aegis-vault-rs
Library for parsing and dumping Aegis vaults
Documentation for the Aegis vault format can be found here
The codebase was initially imported from the Gnome Authenticator project.
Usage
Save a database
use aegis_vault::{
vault::{Aegis, Entry},
algorithm::{Method}
};
use anyhow::Result;
use std::fs::File;
fn main() -> Result<()> {
let mut vault = Aegis::default();
let mut otp_entry = Entry::default();
otp_entry.method = Method::TOTP;
otp_entry.label = "Mason".to_string();
otp_entry.issuer = Some("Deno".to_string());
otp_entry.info.secret = "4SJHB4GSD43FZBAI7C2HLRJGPQ".to_string();
otp_entry.info.period = Some(30);
otp_entry.info.digits = 6;
otp_entry.info.counter = None;
vault.add_entry(otp_entry);
vault.save(
&mut File::create("my-aegis-vault.json")?,
"password",
)?;
Ok(())
}
Open a database
TODO
License
GPL-3
Dependencies
~8–16MB
~303K SLoC