pub fn verify(
    signature: &str,
    message: &str,
    key: &DecodingKey<'_>,
    algorithm: Algorithm
) -> Result<bool>
Expand description

Compares the signature given with a re-computed signature for HMAC or using the public key for RSA/EC.

If you just want to decode a JWT, use decode instead.

signature is the signature part of a jwt (text after the second ‘.’)

message is base64(header) + “.” + base64(claims)