pub struct MemoryKmsClientFactory { /* private fields */ }Expand description
Factory for creating MemoryKeyManagementClient instances.
The factory owns the master-key table and its key size; seed it with
add_master_key /
add_master_key_bytes, then every client it
produces via create_kms_client
shares that same table. Useful for testing encryption flows without a real
KMS backend.
Implementations§
Source§impl MemoryKmsClientFactory
impl MemoryKmsClientFactory
Sourcepub fn with_master_key_size(master_key_size: AesKeySize) -> Self
pub fn with_master_key_size(master_key_size: AesKeySize) -> Self
Creates a new factory whose clients use the given master key size.
Sourcepub fn add_master_key(&self, key_id: impl Into<String>) -> Result<()>
pub fn add_master_key(&self, key_id: impl Into<String>) -> Result<()>
Adds a randomly generated master key with the given ID.
Sourcepub fn add_master_key_bytes(
&self,
key_id: impl Into<String>,
key_bytes: SensitiveBytes,
) -> Result<()>
pub fn add_master_key_bytes( &self, key_id: impl Into<String>, key_bytes: SensitiveBytes, ) -> Result<()>
Adds a master key with explicit key bytes.
Use this to seed the factory with known key material, e.g. for cross-language integration tests where both Java and Rust must share the same master key bytes.
Trait Implementations§
Source§impl Clone for MemoryKmsClientFactory
impl Clone for MemoryKmsClientFactory
Source§fn clone(&self) -> MemoryKmsClientFactory
fn clone(&self) -> MemoryKmsClientFactory
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MemoryKmsClientFactory
impl Debug for MemoryKmsClientFactory
Source§impl Default for MemoryKmsClientFactory
impl Default for MemoryKmsClientFactory
Source§fn default() -> MemoryKmsClientFactory
fn default() -> MemoryKmsClientFactory
Returns the “default value” for a type. Read more
Source§impl KmsClientFactory for MemoryKmsClientFactory
impl KmsClientFactory for MemoryKmsClientFactory
Source§fn create_kms_client<'life0, 'life1, 'async_trait>(
&'life0 self,
_properties: &'life1 HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn KeyManagementClient>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_kms_client<'life0, 'life1, 'async_trait>(
&'life0 self,
_properties: &'life1 HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn KeyManagementClient>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a
KeyManagementClient from catalog properties. Read moreAuto Trait Implementations§
impl Freeze for MemoryKmsClientFactory
impl RefUnwindSafe for MemoryKmsClientFactory
impl Send for MemoryKmsClientFactory
impl Sync for MemoryKmsClientFactory
impl Unpin for MemoryKmsClientFactory
impl UnsafeUnpin for MemoryKmsClientFactory
impl UnwindSafe for MemoryKmsClientFactory
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
Forward to the method defined on the type
Any.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Forward to the method defined on the type
Any.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more