Expand description
Native Vault and Session Agent support for reVault.
This crate includes the Session Agent, a local service that reduces password prompts by keeping lockbox content keys in a short-lived, in-memory process cache.
The Session Agent is started as a platform-specific local service
(Unix socket on Unix, named pipe on Windows), and is used automatically by
lockbox operations when a secret-dependent command needs a cached key.
Its cache uses secure frames for key-bearing traffic, supports TTL-based expiry,
supports explicit session management commands, and automatically clears cache
entries during suspend events.
Key public entry points:
serve_agentstarts the Session Agent in-process.get,put,forget,forget_all,list, andstopoperate the session cache.begin_secret_activityandSecretActivityGuardsupport suspend-protection and optional process termination behavior.local_vaultmanages the on-disk vault and metadata outside the agent cache.
For the runtime behavior, command integration, and security settings, see the
project documentation in docs/lockbox_session_agent.md.
§Example
use revault_vault_api::{SecretString, VaultDirectory};
let password = SecretString::try_from_slice(b"correct horse")?;
let root = std::env::temp_dir().join("my-revault-profile");
let vault = VaultDirectory::open_or_create(root, &password)?;
println!("vault structure version: {}", vault.structure_version()?);See the reVault repository README for the project overview, installation instructions, and complete examples.
Structs§
- Access
Slot Label - Local-only label for one access slot in a remembered lockbox.
- Agent
Client - Content-key store backed by the platform Session Agent.
- Agent
Sleep Support - Platform sleep and suspend capabilities used by the Session Agent.
- Cached
Lockbox - Metadata describing a lockbox whose content key is cached by the agent.
- Known
Lockbox - Lockbox path remembered by the local vault for diagnostics and bulk access refresh operations.
- Noop
Store - Content-key store that never retains keys.
- Platform
Secret Store Status - Current platform credential store state for the default Vault.
- Profile
Generation - One generation of a vault profile.
- Profile
History - Versioned profile history for one vault profile.
- Read
Only Vault Directory - Read-only view of encrypted vault metadata.
- Secret
Activity Guard - Registration guard for a command that may hold decrypted secrets in memory.
- Secret
String - Secure string type re-exported from
revault_lockbox_api. UTF-8 secret stored in guarded, zeroizing memory. - Secret
Vec - Secure string type re-exported from
revault_lockbox_api. Variable-length byte sequence stored in guarded, zeroizing memory. - Stored
Contact - Contact entry stored in a
VaultDirectory. - Vault
- High-level lockbox helper that integrates open operations with a key cache.
- Vault
Backup Manifest - Metadata stored in an encrypted vault backup archive.
- Vault
Directory - Password-protected vault file for native reVault metadata.
Enums§
- Auto
Open Scope - Scope controlled by the session auto-open setting.
- KeyFormat
- Supported contact key serialization formats.
- Profile
Generation Status - Lifecycle state of one Profile key generation.
- Secret
Activity Kind - Category of an operation that temporarily requires secret access.
Constants§
- CURRENT_
VAULT_ STRUCTURE_ VERSION - Current on-disk structure version for records stored inside the local vault.
- FINGERPRINT_
CODE_ 96_ LEN - Number of bytes encoded by the short, human-comparable fingerprint code.
- PUBLIC_
KEY_ FINGERPRINT_ LEN - Number of SHA-256 prefix bytes used for a contact public-key fingerprint.
Traits§
- Content
KeyStore - Storage backend for opened Lockbox content keys.
Functions§
- agent_
log_ destination - Describes where Session Agent events are currently written.
- agent_
log_ path - Returns the file used when agent events cannot be sent to the platform log.
- agent_
sleep_ support - Returns sleep/suspend capabilities compiled for the current platform.
- auto_
open_ scope - Returns the effective automatic-open scope for the default local vault.
- backup_
default_ vault - Writes a consistent encrypted backup archive for the default local vault.
- begin_
secret_ activity - Registers the current process as running a high-level secret activity.
- decode_
fingerprint_ crockford_ 96 - Decodes a 96-bit lower/upper-case Crockford fingerprint code.
- decode_
fingerprint_ hex - Decodes a public-key fingerprint written as hex, with optional separators.
- decode_
hex - Decodes hexadecimal text into bytes.
- default_
vault_ dir - Returns the default directory for the local vault.
- default_
vault_ path - Returns the default path to the local vault file.
- disable_
platform_ secret_ store - Disables platform credential store lookup for the default Vault.
- enable_
platform_ secret_ store - Enables platform credential store lookup for the default Vault.
- encode_
hex - Encodes bytes as lowercase hexadecimal text.
- export_
private_ key - Exports a contact private key in the requested format.
- export_
public_ key - Exports a contact public key in the requested format.
- forget
- Removes one content key from the platform agent.
- forget_
all - Removes all content keys from the platform agent.
- forget_
owner_ signing_ key - Removes one cached owner-signing key.
- forget_
platform_ vault_ password - Removes the default Vault passphrase from the platform credential store.
- forget_
vault_ unlock_ key - Removes the cached vault unlock secret for one vault.
- format_
fingerprint_ crockford_ 96 - Formats the first 96 bits of a fingerprint as lower-case Crockford Base32.
- format_
fingerprint_ crockford_ 96_ reading - Returns a lower-case word reading for a Crockford fingerprint code.
- format_
fingerprint_ hex_ pairs - Formats fingerprint bytes as lowercase space-separated hexadecimal pairs.
- get
- Reads a cached content key from the platform agent.
- get_
owner_ signing_ key - Reads one cached owner-signing key for a specific vault profile.
- get_
platform_ vault_ password - Loads the default Vault passphrase from the platform credential store.
- get_
platform_ vault_ password_ for - Loads the passphrase for the Vault directory at
path_to. - get_
vault_ unlock_ key - Reads the cached vault unlock secret for a specific vault profile.
- import_
private_ key - Imports a contact private key from PEM, JWK, JWKS-compatible JWK, or hex.
- import_
private_ key_ file - Reads and imports a contact private key from a file.
- import_
public_ key - Imports a contact public key from Lockbox PEM, JWK, JWKS, or raw hex.
- is_
running - Returns true when the platform agent transport is currently reachable.
- list
- Lists cached lockboxes known to the platform agent.
- local_
vault - Creates a
Vaultbacked by the default platform agent. - platform_
secret_ store_ disabled - Returns true when platform credential store lookup should not be attempted.
- platform_
secret_ store_ status - Returns the platform credential store status for the default Vault.
- public_
key_ fingerprint - Returns the stable fingerprint for a contact public key.
- put
- Stores a content key in the platform agent.
- put_
owner_ signing_ key - Caches an owner-signing key that was already loaded by the normal vault flow. The key remains in secure memory while it crosses the local IPC boundary and inside the agent cache.
- put_
platform_ vault_ password - Stores the default Vault passphrase in the platform credential store.
- put_
vault_ unlock_ key - Caches a vault unlock secret obtained through the normal vault flow.
- restore_
default_ vault - Restores the default local vault from an encrypted backup archive.
- serve_
agent - Runs the platform content-key agent in the current process.
- session_
agent_ dir - Returns the platform-specific directory used for Session Agent state.
- set_
auto_ open_ scope - Persists the automatic-open scope for the default local vault.
- start
- Starts the Session Agent if it is not already running.
- stop
- Stops the platform agent after clearing all cached content keys.
- validate_
vault_ record_ name - Validates a profile or contact name used by the native vault.
- verify_
agent_ transport_ security - Verifies that the current platform agent transport is configured securely.
Type Aliases§
- Local
Vault - Vault using the default platform agent as its content-key store.