1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! # 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
//!
//! ```rust
//! use age_vault::{Vault, Role};
//! use std::path::PathBuf;
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! 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)?;
//! # Ok(())
//! # }
//! ```
/// Re-export of [`account::Account`].
pub use Account;
/// Re-export of [`account::Role`].
pub use Role;
/// Re-export of [`error::Error`].
pub use Error;
/// Re-export of [`error::Result`].
pub use Result;
/// Re-export of [`vault::Vault`].
pub use Vault;