pub trait MACLike {
Show 13 methods
// 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: &[u8]) -> Vec<u8> ⓘ;
// Provided methods
fn salt(&self) -> Salt { ... }
fn verifier_salt(&self) -> Result<Salt, Error> { ... }
fn attach_salt(&mut self, salt: Salt) -> Result<(), Error> { ... }
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: &[u8]) -> Vec<u8> ⓘ
Provided Methods§
Sourcefn 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.
Sourcefn 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.
Sourcefn 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
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.