Function alcoholic_jwt::validate[][src]

pub fn validate(
    token: &str,
    jwk: &JWK,
    validations: Vec<Validation>
) -> Result<ValidJWT, ValidationError>

Validate the signature of a JSON Web Token and optionally apply claim validations. Signatures are always verified before claims, and if a signature verification passes all claim validations are run and returned.

If validation succeeds a representation of the token is returned that contains the header and claims as simple JSON values.

It is the user's task to ensure that the correct JWK is passed in for validation.