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
//! # memseal
//!
//! Encrypt and store secrets in memory with password-based key derivation,
//! authenticated encryption, and automatic zeroization.
//!
//! ## Quick Start
//!
//! ```
//! use memseal::Vault;
//!
//! // Create a vault protected by a password (>= 8 bytes)
//! let mut vault = Vault::create(b"my-password-here").unwrap();
//!
//! // Store secrets
//! vault.store("api_key", b"sk-secret-12345").unwrap();
//! vault.store("db_url", b"postgres://user:pass@host/db").unwrap();
//!
//! // Export to bytes (for persistence or transmission)
//! let bytes = vault.export().unwrap();
//!
//! // Reopen with the same password
//! let reopened = Vault::open(b"my-password-here", &bytes).unwrap();
//! assert_eq!(
//! reopened.retrieve("api_key").unwrap(),
//! Some(b"sk-secret-12345".to_vec()),
//! );
//! ```
//!
//! ## File Persistence
//!
//! ```no_run
//! use memseal::Vault;
//! use std::path::Path;
//!
//! let mut vault = Vault::create(b"password1234")?;
//! vault.store("secret", b"value")?;
//!
//! // Save to disk
//! vault.save(Path::new("vault.seal"))?;
//!
//! // Load from disk
//! let loaded = Vault::load(Path::new("vault.seal"), b"password1234")?;
//! # Ok::<(), memseal::VaultError>(())
//! ```
pub use Vault;
pub use VaultError;