Skip to main content

ContentKeyStore

Trait ContentKeyStore 

Source
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§

Source

fn get_content_key( &self, lockbox_id: LockboxId, ) -> Result<Option<SecureVec>, Error>

Returns the cached content key for lockbox_id, if one is available.

Source

fn put_content_key( &self, lockbox_id: LockboxId, key: SecureVec, ) -> Result<(), Error>

Stores the opened content key for lockbox_id.

Source

fn forget_content_key(&self, lockbox_id: LockboxId) -> Result<(), Error>

Removes the cached content key for lockbox_id.

Source

fn forget_all_content_keys(&self) -> Result<(), Error>

Removes all cached content keys known to this store.

Provided Methods§

Source

fn put_content_key_for_path( &self, lockbox_id: LockboxId, key: SecureVec, _path: &Path, ) -> Result<(), Error>

Stores the opened content key with a display path for diagnostics.

Source

fn put_content_key_for_path_with_ttl( &self, lockbox_id: LockboxId, key: SecureVec, path: &Path, _ttl_seconds: u64, ) -> Result<(), Error>

Stores the opened content key with an explicit cache lifetime.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§