pub struct SecretBytes { /* private fields */ }Expand description
HMAC key material for the audit chain.
Empty and all-whitespace keys are rejected. The key intentionally has no
public Debug, Display, or AsRef<[u8]> implementation.
Implementations§
Source§impl SecretBytes
impl SecretBytes
Sourcepub fn new(bytes: impl Into<Vec<u8>>) -> Result<Self, EmptyKeyError>
pub fn new(bytes: impl Into<Vec<u8>>) -> Result<Self, EmptyKeyError>
Wraps owned bytes as an HMAC secret.
§Errors
Returns EmptyKeyError if the byte slice is empty or all whitespace.
Sourcepub fn try_from_slice(bytes: &[u8]) -> Result<Self, EmptyKeyError>
pub fn try_from_slice(bytes: &[u8]) -> Result<Self, EmptyKeyError>
Copies the slice and wraps it as an HMAC secret.
§Errors
Returns EmptyKeyError if the slice is empty or all whitespace.
Auto Trait Implementations§
impl Freeze for SecretBytes
impl RefUnwindSafe for SecretBytes
impl Send for SecretBytes
impl Sync for SecretBytes
impl Unpin for SecretBytes
impl UnsafeUnpin for SecretBytes
impl UnwindSafe for SecretBytes
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