pub fn verify<ExtraClaims: DeserializeOwned>(
        &self,
        token: &str,
    ) -> Result<HeaderAndClaims<ExtraClaims>> {
        let mut parts = token.split('.');

        let mut header = parts.next().ok_or(Error::InvalidToken)?.as_bytes();

        let header_r = base64::read::DecoderReader::new(&mut header, url_safe_trailing_bits());
        let header: Header = serde_json::from_reader(header_r)?;

        let kid = header.kid.as_deref().ok_or(Error::NoKid)?;
        let k = self.find(kid).ok_or(Error::NoKey)?;

        verify(token, k)
    }
/// Decode and verify token with keys from this JWK set.
///
/// The `alg`, `exp` and `nbf` fields are automatically checked.
Decode and verify token with keys from this JWK set.
Decode and verify token with keys from this JWK set .
pub fn verify<ExtraClaims: DeserializeOwned>(
        &self,
        token: &str,
    ) -> Result<HeaderAndClaims<ExtraClaims>> {
        let mut parts = token.split('.');
        let mut header = parts.next().ok_or(Error::InvalidToken)?.as_bytes();
        let header_r = base64::read::DecoderReader::new(&mut header, url_safe_trailing_bits());
        let header: Header = serde_json::from_reader(header_r)?;
        let kid = header.kid.as_deref().ok_or(Error::NoKid)?;
        let k = self.find(kid).ok_or(Error::NoKey)?;
        verify(token, k)
    }
pub fn verify < ExtraClaims : DeserializeOwned > ( & self , token : & str , ) -> Result < HeaderAndClaims < ExtraClaims > > { let mut parts = token . split ( '.' ) ; let mut header = parts . next ( ) . ok_or ( Error :: InvalidToken ) ? . as_bytes ( ) ; let header_r = base64 :: read :: DecoderReader :: new ( & mut header , url_safe_trailing_bits ( ) ) ; let header : Header = serde_json :: from_reader ( header_r ) ? ; let kid = header . kid . as_deref ( ) . ok_or ( Error :: NoKid ) ? ; let k = self . find ( kid ) . ok_or ( Error :: NoKey ) ? ; verify ( token , k ) }
Decode and verify token with keys from this JWK set.
Decode and verify token with keys from this JWK set .
&self
token
&str
&self
token
&str