Struct StaticKeyProvider
pub struct StaticKeyProvider(/* private fields */);Expand description
Wraps an existing ClientKey as a KeyProvider.
Useful for tests or when the key is already available programmatically.
§Example
use cipherstash_client::zerokms::{StaticKeyProvider, KeyProvider, ClientKey};
use uuid::Uuid;
let provider = StaticKeyProvider::new(client_key);
let key = provider.client_key().await.unwrap();Implementations§
§impl StaticKeyProvider
impl StaticKeyProvider
pub fn new(key: ClientKey) -> Self
pub fn new(key: ClientKey) -> Self
Create a new StaticKeyProvider wrapping the given key.
Trait Implementations§
§impl KeyProvider for StaticKeyProvider
impl KeyProvider for StaticKeyProvider
§async fn client_key(&self) -> Result<ClientKey, KeyProviderError>
async fn client_key(&self) -> Result<ClientKey, KeyProviderError>
Load a
ClientKey from this provider.Auto Trait Implementations§
impl Freeze for StaticKeyProvider
impl RefUnwindSafe for StaticKeyProvider
impl Send for StaticKeyProvider
impl Sync for StaticKeyProvider
impl Unpin for StaticKeyProvider
impl UnsafeUnpin for StaticKeyProvider
impl UnwindSafe for StaticKeyProvider
Blanket Implementations§
impl<T> AuthStrategyBounds for T
Source§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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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