Class JwksSignature

    • Field Detail

      • DEFAULT_REFRESH_JWKS_ATTEMPTS

        @Deprecated
        public static final int DEFAULT_REFRESH_JWKS_ATTEMPTS
        Deprecated.
        See Also:
        Constant Field Values
    • Method Detail

      • isExpired

        public boolean isExpired()
        Specified by:
        isExpired in interface JwksCache
        Returns:
        Whether the cache is expired or empty optional if JWKS still not cached
      • clear

        public void clear()
        Description copied from interface: JwksCache
        Clears the JWK Set cache.
        Specified by:
        clear in interface JwksCache
      • isPresent

        public boolean isPresent()
        Specified by:
        isPresent in interface JwksCache
        Returns:
        Whether the cache has been populated.
      • getKeyIds

        @NonNull
        public java.util.Optional<java.util.List<java.lang.String>> getKeyIds()
        Specified by:
        getKeyIds in interface JwksCache
      • supports

        public boolean supports​(com.nimbusds.jose.JWSAlgorithm algorithm)
        Whether this signature configuration supports this algorithm.
        Specified by:
        supports in interface SignatureConfiguration
        Parameters:
        algorithm - the signature algorithm
        Returns:
        whether this signature configuration supports this algorithm
      • verify

        public boolean verify​(com.nimbusds.jwt.SignedJWT jwt)
                       throws com.nimbusds.jose.JOSEException
        Verify a signed JWT.
        Specified by:
        verify in interface SignatureConfiguration
        Parameters:
        jwt - the signed JWT
        Returns:
        whether the signed JWT is verified
        Throws:
        com.nimbusds.jose.JOSEException - exception when verifying the JWT
      • loadJwkSet

        @Nullable
        protected com.nimbusds.jose.jwk.JWKSet loadJwkSet​(java.lang.String url)
        Instantiates a JWKSet for a given url.
        Parameters:
        url - JSON Web Key Set Url.
        Returns:
        a JWKSet or null if there was an error.
      • matches

        @Deprecated
        protected java.util.List<com.nimbusds.jose.jwk.JWK> matches​(com.nimbusds.jwt.SignedJWT jwt,
                                                                    @Nullable
                                                                    com.nimbusds.jose.jwk.JWKSet jwkSet,
                                                                    int refreshKeysAttempts)
        Deprecated.
        Calculates a list of JWK matches for a JWT.
        Parameters:
        jwt - A Signed JWT
        jwkSet - A JSON Web Key Set
        refreshKeysAttempts - Number of times to attempt refreshing the JWK Set
        Returns:
        a List of JSON Web Keys
      • matches

        @Deprecated
        protected java.util.List<com.nimbusds.jose.jwk.JWK> matches​(com.nimbusds.jwt.SignedJWT jwt,
                                                                    @Nullable
                                                                    com.nimbusds.jose.jwk.JWKSet jwkSet)
        Calculates a list of JWK matches for a JWT.
        Parameters:
        jwt - A Signed JWT
        jwkSet - A JSON Web Key Set
        Returns:
        a List of JSON Web Keys
      • verify

        protected boolean verify​(java.util.List<com.nimbusds.jose.jwk.JWK> matches,
                                 com.nimbusds.jwt.SignedJWT jwt)
        returns true if any JWK match is able to verify the JWT signature.
        Parameters:
        matches - A List of JSON Web key matches.
        jwt - A JWT to be verified.
        Returns:
        true if the JWT signature could be verified.
      • getRefreshJwksAttempts

        @Deprecated
        public int getRefreshJwksAttempts()
        Deprecated.
        Returns the number of attempts to refresh the cached JWKS.
        Returns:
        Number of attempts to refresh the cached JWKS.
      • getJwkValidator

        @Deprecated
        public JwkValidator getJwkValidator()
        Deprecated.
        Returns:
        A JSON Web Key Validator.
      • getJwkSet

        @Deprecated
        public com.nimbusds.jose.jwk.JWKSet getJwkSet()
        Deprecated.
        Returns:
        a JSON Web Key Set.
      • getKeyType

        @Deprecated
        public com.nimbusds.jose.jwk.KeyType getKeyType()
        Deprecated.
        Returns:
        the Key Type.
      • getUrl

        @Deprecated
        public java.lang.String getUrl()
        Deprecated.
        Returns:
        The JSON Web Key Set (JWKS) URL.