pub struct LocalPepper { /* private fields */ }Expand description
In-memory pepper provider. Keys live in process memory — use a real KMS for production secrets.
Implementations§
Source§impl LocalPepper
impl LocalPepper
Sourcepub fn builder() -> LocalPepperBuilder
pub fn builder() -> LocalPepperBuilder
Starts building a LocalPepper.
Sourcepub fn versions(&self) -> Vec<KeyVersion>
pub fn versions(&self) -> Vec<KeyVersion>
Returns the set of key versions held in memory, sorted ascending.
Trait Implementations§
Source§impl Debug for LocalPepper
impl Debug for LocalPepper
Source§impl Drop for LocalPepper
impl Drop for LocalPepper
Source§impl Pepper for LocalPepper
impl Pepper for LocalPepper
Source§fn apply(
&self,
version: KeyVersion,
password: &[u8],
) -> Result<[u8; 32], PepperError>
fn apply( &self, version: KeyVersion, password: &[u8], ) -> Result<[u8; 32], PepperError>
Computes
HMAC-SHA-256(key_at(version), password) and returns
the 32-byte tag. Errors if the requested version is not
available in this provider. Read moreSource§fn current(&self) -> KeyVersion
fn current(&self) -> KeyVersion
Returns the key version to use for new hashes. Older versions
remain usable via
Pepper::apply for verifying existing
hashes; rotation is handled by hsh::api::verify_and_upgrade.Auto Trait Implementations§
impl Freeze for LocalPepper
impl RefUnwindSafe for LocalPepper
impl Send for LocalPepper
impl Sync for LocalPepper
impl Unpin for LocalPepper
impl UnsafeUnpin for LocalPepper
impl UnwindSafe for LocalPepper
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