pub struct SecretHasher<K> { /* private fields */ }Expand description
Derives LookupKeys from secrets using a KeyProvider.
Implementations§
Source§impl<K: KeyProvider> SecretHasher<K>
impl<K: KeyProvider> SecretHasher<K>
Sourcepub fn key_provider(&self) -> &K
pub fn key_provider(&self) -> &K
Borrow the underlying key provider.
Sourcepub fn lookup_key(
&self,
domain: SecretDomain,
value: &str,
) -> Result<(LookupKey, KeyVersion), KeyError>
pub fn lookup_key( &self, domain: SecretDomain, value: &str, ) -> Result<(LookupKey, KeyVersion), KeyError>
Derive a lookup key for value in domain using the active key.
Returns the key plus the active KeyVersion to store alongside it.
§Errors
Propagates KeyError from the provider (e.g. missing active key).
Sourcepub fn lookup_key_with_version(
&self,
domain: SecretDomain,
value: &str,
version: &KeyVersion,
) -> Result<LookupKey, KeyError>
pub fn lookup_key_with_version( &self, domain: SecretDomain, value: &str, version: &KeyVersion, ) -> Result<LookupKey, KeyError>
Derive a lookup key for value in domain using a specific key
version. Used during validation to re-derive candidates for records
written under older keys.
§Errors
Propagates KeyError::MissingKeyVersion if the version is unknown.
Trait Implementations§
Source§impl<K: Clone> Clone for SecretHasher<K>
impl<K: Clone> Clone for SecretHasher<K>
Source§fn clone(&self) -> SecretHasher<K>
fn clone(&self) -> SecretHasher<K>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<K> Freeze for SecretHasher<K>where
K: Freeze,
impl<K> RefUnwindSafe for SecretHasher<K>where
K: RefUnwindSafe,
impl<K> Send for SecretHasher<K>where
K: Send,
impl<K> Sync for SecretHasher<K>where
K: Sync,
impl<K> Unpin for SecretHasher<K>where
K: Unpin,
impl<K> UnsafeUnpin for SecretHasher<K>where
K: UnsafeUnpin,
impl<K> UnwindSafe for SecretHasher<K>where
K: UnwindSafe,
Blanket Implementations§
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