pub struct Blake2bKey { /* private fields */ }
Implementations§
Source§impl Blake2bKey
impl Blake2bKey
pub fn from_bytes(raw_key: &[u8]) -> Self
pub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn generate() -> Self
pub fn generate_with_salt() -> Self
pub fn with_key_id(self, key_id: &str) -> Self
Trait Implementations§
Source§impl Clone for Blake2bKey
impl Clone for Blake2bKey
Source§fn clone(&self) -> Blake2bKey
fn clone(&self) -> Blake2bKey
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Blake2bKey
impl Debug for Blake2bKey
Source§impl MACLike for Blake2bKey
impl MACLike for Blake2bKey
fn jwt_alg_name() -> &'static str
fn key(&self) -> &HMACKey
fn key_id(&self) -> &Option<String>
fn set_key_id(&mut self, key_id: String)
fn metadata(&self) -> &Option<KeyMetadata>
fn attach_metadata(&mut self, metadata: KeyMetadata) -> Result<(), Error>
fn authentication_tag(&self, authenticated: &[u8]) -> Vec<u8> ⓘ
Source§fn verifier_salt(&self) -> Result<Salt, Error>
fn verifier_salt(&self) -> Result<Salt, Error>
Compute the salt to be used for verification, given a signer salt.
Source§fn authenticate<CustomClaims: Serialize + DeserializeOwned>(
&self,
claims: JWTClaims<CustomClaims>,
) -> Result<String, Error>
fn authenticate<CustomClaims: Serialize + DeserializeOwned>( &self, claims: JWTClaims<CustomClaims>, ) -> Result<String, Error>
Authenticate a token.
Source§fn verify_token<CustomClaims: Serialize + DeserializeOwned>(
&self,
token: &str,
options: Option<VerificationOptions>,
) -> Result<JWTClaims<CustomClaims>, Error>
fn verify_token<CustomClaims: Serialize + DeserializeOwned>( &self, token: &str, options: Option<VerificationOptions>, ) -> Result<JWTClaims<CustomClaims>, Error>
Verify a token.
fn create_key_id(&mut self) -> &str
Auto Trait Implementations§
impl Freeze for Blake2bKey
impl RefUnwindSafe for Blake2bKey
impl Send for Blake2bKey
impl Sync for Blake2bKey
impl Unpin for Blake2bKey
impl UnwindSafe for Blake2bKey
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