pub struct HmacSha256Key { /* private fields */ }Expand description
A HS256 key.
Implementations§
Source§impl HmacSha256Key
impl HmacSha256Key
Sourcepub fn generate() -> HmacSha256Key
pub fn generate() -> HmacSha256Key
Generates a random 256-bit HmacSha256Key.
Sourcepub fn from_bytes(key: &[u8]) -> Result<HmacSha256Key, Error>
pub fn from_bytes(key: &[u8]) -> Result<HmacSha256Key, Error>
Creates a new HmacSha256Key from bytes. Returns an error is the key is shorter than
16 bytes (128 bits).
pub fn as_bytes(&self) -> &[u8] ⓘ
Trait Implementations§
Source§impl Drop for HmacSha256Key
impl Drop for HmacSha256Key
Source§impl From<&HmacSha256Key> for Jwk
impl From<&HmacSha256Key> for Jwk
Source§fn from(key: &HmacSha256Key) -> Self
fn from(key: &HmacSha256Key) -> Self
Converts to this type from the input type.
Source§impl Signer for HmacSha256Key
impl Signer for HmacSha256Key
Source§impl Verifier for HmacSha256Key
impl Verifier for HmacSha256Key
Auto Trait Implementations§
impl Freeze for HmacSha256Key
impl RefUnwindSafe for HmacSha256Key
impl Send for HmacSha256Key
impl Sync for HmacSha256Key
impl Unpin for HmacSha256Key
impl UnsafeUnpin for HmacSha256Key
impl UnwindSafe for HmacSha256Key
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