Struct min_jwt::sign::ring::HmacKeySigner
source · pub struct HmacKeySigner<K, A>{ /* private fields */ }
Available on crate feature
ring
only.Expand description
Wrapper for ::ring::hmac::Key
.
Examples
HS256
let hmac_key = ::ring::hmac::Key::new(::ring::hmac::HMAC_SHA256, &hmac_key_bytes);
let signer = min_jwt::sign::ring::HmacKeySigner::with_hs256(hmac_key);
let jwt = min_jwt::encode_and_sign(header.as_bytes(), claims.as_bytes(), &signer);
Implementations§
source§impl<K, A> HmacKeySigner<K, A>
impl<K, A> HmacKeySigner<K, A>
sourcepub fn into_inner(self) -> K
pub fn into_inner(self) -> K
Returns the inner key.
source§impl<K> HmacKeySigner<K, Hs256>where
K: HmacKey,
impl<K> HmacKeySigner<K, Hs256>where
K: HmacKey,
sourcepub fn with_hs256(key: K) -> HmacKeySigner<K, Hs256>
pub fn with_hs256(key: K) -> HmacKeySigner<K, Hs256>
Creates a new Hs256
key signer.
Trait Implementations§
source§impl<K, A> Debug for HmacKeySigner<K, A>
impl<K, A> Debug for HmacKeySigner<K, A>
source§impl<K, A> Signer for HmacKeySigner<K, A>
impl<K, A> Signer for HmacKeySigner<K, A>
Auto Trait Implementations§
impl<K, A> RefUnwindSafe for HmacKeySigner<K, A>where
A: RefUnwindSafe,
K: RefUnwindSafe,
impl<K, A> Send for HmacKeySigner<K, A>
impl<K, A> Sync for HmacKeySigner<K, A>
impl<K, A> Unpin for HmacKeySigner<K, A>
impl<K, A> UnwindSafe for HmacKeySigner<K, A>where
A: UnwindSafe,
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