pub trait ContentKeyStore {
// Required methods
fn get_content_key(
&self,
lockbox_id: LockboxId,
) -> Result<Option<SecureVec>, Error>;
fn put_content_key(
&self,
lockbox_id: LockboxId,
key: SecureVec,
) -> Result<(), Error>;
fn forget_content_key(&self, lockbox_id: LockboxId) -> Result<(), Error>;
fn forget_all_content_keys(&self) -> Result<(), Error>;
// Provided methods
fn put_content_key_for_path(
&self,
lockbox_id: LockboxId,
key: SecureVec,
_path: &Path,
) -> Result<(), Error> { ... }
fn put_content_key_for_path_with_ttl(
&self,
lockbox_id: LockboxId,
key: SecureVec,
path: &Path,
_ttl_seconds: u64,
) -> Result<(), Error> { ... }
}Expand description
Storage backend for opened Lockbox content keys.
Vault uses this trait to cache content keys after a lockbox is created or
opened, and to retrieve them for later cache-only opens. Implementations
may keep keys in memory, forward them to a local agent, or deliberately
discard them.
Required Methods§
Sourcefn get_content_key(
&self,
lockbox_id: LockboxId,
) -> Result<Option<SecureVec>, Error>
fn get_content_key( &self, lockbox_id: LockboxId, ) -> Result<Option<SecureVec>, Error>
Returns the cached content key for lockbox_id, if one is available.
Sourcefn put_content_key(
&self,
lockbox_id: LockboxId,
key: SecureVec,
) -> Result<(), Error>
fn put_content_key( &self, lockbox_id: LockboxId, key: SecureVec, ) -> Result<(), Error>
Stores the opened content key for lockbox_id.
Sourcefn forget_content_key(&self, lockbox_id: LockboxId) -> Result<(), Error>
fn forget_content_key(&self, lockbox_id: LockboxId) -> Result<(), Error>
Removes the cached content key for lockbox_id.
Sourcefn forget_all_content_keys(&self) -> Result<(), Error>
fn forget_all_content_keys(&self) -> Result<(), Error>
Removes all cached content keys known to this store.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".