pub struct HmacKey { /* private fields */ }Expand description
HMAC key material.
The key is copied into an owned zeroizing buffer before use so callers can drop their input independently and the primitive controls memory cleanup.
Implementations§
Source§impl HmacKey
impl HmacKey
Sourcepub fn from_slice(input: &[u8]) -> Result<HmacKey, CryptoError>
pub fn from_slice(input: &[u8]) -> Result<HmacKey, CryptoError>
Constructs an HMAC key from raw bytes.
Empty keys are rejected because they provide no secret entropy. Very large keys are rejected to keep allocation behavior deterministic at FFI and platform boundaries.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HmacKey
impl RefUnwindSafe for HmacKey
impl Send for HmacKey
impl Sync for HmacKey
impl Unpin for HmacKey
impl UnsafeUnpin for HmacKey
impl UnwindSafe for HmacKey
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