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§

source

fn jwt_alg_name() -> &'static str

source

fn key(&self) -> &HMACKey

source

fn key_id(&self) -> &Option<String>

source

fn set_key_id(&mut self, key_id: String)

source

fn metadata(&self) -> &Option<KeyMetadata>

source

fn attach_metadata(&mut self, metadata: KeyMetadata) -> Result<(), Error>

source

fn authentication_tag(&self, authenticated: &str) -> Vec<u8>

Provided Methods§

source

fn authenticate<CustomClaims: Serialize + DeserializeOwned>( &self, claims: JWTClaims<CustomClaims> ) -> Result<String, Error>

source

fn verify_token<CustomClaims: Serialize + DeserializeOwned>( &self, token: &str, options: Option<VerificationOptions> ) -> Result<JWTClaims<CustomClaims>, Error>

source

fn create_key_id(&mut self) -> &str

Implementors§