MemoryStore

Struct MemoryStore 

Source
pub struct MemoryStore { /* private fields */ }
Expand description

In-memory key store

Thread-safe storage backend for testing and high performance scenerios where persistence is not required, please remember that all keys are lost when dropped

Implementations§

Source§

impl MemoryStore

Source

pub fn new() -> Self

Create a new in-memory store

Trait Implementations§

Source§

impl Default for MemoryStore

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl KeyLifeCycle for MemoryStore

Source§

fn deprecate_key(&mut self, id: &KeyId) -> Result<()>

Mark a particular key as deprecated (key should be able to decrypt but not encrypt)
Source§

fn revoke_key(&mut self, id: &KeyId) -> Result<()>

Revoke a key (key should not be used for any operations)
Source§

fn cleanup_old_versions( &mut self, id: &KeyId, keep_versions: usize, ) -> Result<Vec<KeyId>>

Clean up old versions based on policy
Source§

impl KeyStore for MemoryStore

Source§

fn store(&mut self, key: VersionedKey) -> Result<()>

Store a versioned key
Source§

fn retrieve(&self, id: &KeyId) -> Result<VersionedKey>

Retrieve a key by ID
Source§

fn delete(&mut self, id: &KeyId) -> Result<()>

Delete a key
Source§

fn list(&self) -> Result<Vec<KeyId>>

List all kety IDs
Source§

fn update_metadata(&mut self, id: &KeyId, metadata: KeyMetadata) -> Result<()>

Update key metadata
Source§

fn find_by_state(&self, state: KeyState) -> Result<Vec<KeyId>>

Find keys by state
Source§

fn rotate_key(&mut self, id: &KeyId) -> Result<VersionedKey>

Rotate a key to a new version
Source§

fn get_key_versions(&self, id: &KeyId) -> Result<Vec<VersionedKey>>

Get all verions of a key (sorted by version number)
Source§

fn get_latest_key(&self, id: &KeyId) -> Result<VersionedKey>

Get the latest active version of a key

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V