Expand description
§Age Vault
A secure vault for managing age-encrypted accounts and data.
This crate provides a file-based vault that stores accounts (each with an age keypair) encrypted using a master password. It supports adding/removing accounts, listing them, and encrypting/decrypting arbitrary data for specific recipients.
§Example
use age_vault::{Vault, Role};
use std::path::PathBuf;
let path = PathBuf::from("./test_vault.ndbx");
let master_pw = "my_secure_master_password";
// Create a new vault
let mut vault = Vault::create(&path, master_pw)?;
// Add an account
let account = vault.add_account("alice", Role::Admin)?;
// Encrypt data for Alice
let plaintext = b"secret message";
let ciphertext = vault.encrypt_for(&["alice"], plaintext)?;
// Decrypt using Alice's key
let decrypted = vault.decrypt_with("alice", &ciphertext)?;
assert_eq!(decrypted, plaintext);
// Clean up
std::fs::remove_file(&path)?;Re-exports§
pub use account::Account;pub use account::Role;pub use error::Error;pub use error::Result;pub use vault::Vault;