pub trait MACLike {
// Required methods
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: &str) -> Vec<u8>;
// Provided methods
fn authenticate<CustomClaims: Serialize + DeserializeOwned>(
&self,
claims: JWTClaims<CustomClaims>,
) -> Result<String, Error> { ... }
fn verify_token<CustomClaims: Serialize + DeserializeOwned>(
&self,
token: &str,
options: Option<VerificationOptions>,
) -> Result<JWTClaims<CustomClaims>, Error> { ... }
fn create_key_id(&mut self) -> &str { ... }
}
Required Methods§
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: &str) -> Vec<u8>
Provided Methods§
fn authenticate<CustomClaims: Serialize + DeserializeOwned>( &self, claims: JWTClaims<CustomClaims>, ) -> Result<String, Error>
fn verify_token<CustomClaims: Serialize + DeserializeOwned>( &self, token: &str, options: Option<VerificationOptions>, ) -> Result<JWTClaims<CustomClaims>, Error>
fn create_key_id(&mut self) -> &str
Object Safety§
This trait is not object safe.