pub fn decode(
token: &str,
verifying_key: &VerifyingKey,
validation_options: &ValidationOptions,
) -> Result<DecodedJwt, Error>
Expand description
Decodes and validates a JWT using the provided verification key and validation options.
§Arguments
token
- The encoded JWT string.verifying_key
- The key to be used for signature verification.options
- The validation options for the claims within the JWT.
§Returns
Returns a DecodedJwt
structure containing the header, payload, and signature if successful,
or an Error
if decoding or validation fails.