Crates.io | aegis-vault |
lib.rs | aegis-vault |
version | 0.3.3 |
source | src |
created_at | 2023-07-23 23:03:34.11734 |
updated_at | 2024-09-29 16:12:09.878149 |
description | Library for parsing and dumping Aegis vaults |
homepage | https://github.com/louib/aegis-vault-rs |
repository | https://github.com/louib/aegis-vault-rs |
max_upload_size | |
id | 924064 |
size | 69,665 |
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.
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(())
}
TODO
GPL-3