Trait jwt_compact::AlgorithmExt[][src]

pub trait AlgorithmExt: Algorithm {
    fn token<T>(
        &self,
        header: Header,
        claims: &Claims<T>,
        signing_key: &Self::SigningKey
    ) -> Result<String, CreationError>
    where
        T: Serialize
;
fn compact_token<T>(
        &self,
        header: Header,
        claims: &Claims<T>,
        signing_key: &Self::SigningKey
    ) -> Result<String, CreationError>
    where
        T: Serialize
;
fn validate_integrity<T>(
        &self,
        token: &UntrustedToken<'_>,
        verifying_key: &Self::VerifyingKey
    ) -> Result<Token<T>, ValidationError>
    where
        T: DeserializeOwned
;
fn validate_for_signed_token<T>(
        &self,
        token: &UntrustedToken<'_>,
        verifying_key: &Self::VerifyingKey
    ) -> Result<SignedToken<Self, T>, ValidationError>
    where
        T: DeserializeOwned
; }
Expand description

Automatically implemented extensions of the Algorithm trait.

Required methods

Creates a new token and serializes it to string.

This is supported on crate feature serde_cbor only.

Creates a new token with CBOR-encoded claims and serializes it to string.

Validates the token integrity against the provided verifying_key.

Validates the token integrity against the provided verifying_key.

Unlike validate_integrity, this method retains more information about the original token, in particular, its signature.

Implementors