Class JwksVerificationKeyResolver

java.lang.Object
org.jose4j.keys.resolvers.JwksVerificationKeyResolver
All Implemented Interfaces:
VerificationKeyResolver

public class JwksVerificationKeyResolver extends Object implements VerificationKeyResolver
  • Constructor Details

    • JwksVerificationKeyResolver

      public JwksVerificationKeyResolver(List<JsonWebKey> jsonWebKeys)
  • Method Details

    • resolveKey

      public Key resolveKey(JsonWebSignature jws, List<JsonWebStructure> nestingContext) throws UnresolvableKeyException
      Description copied from interface: VerificationKeyResolver
      Choose the key to be used for signature verification on the given JWS.
      Specified by:
      resolveKey in interface VerificationKeyResolver
      Parameters:
      jws - the JsonWebSignature that's about to be verified
      nestingContext - a list of JOSE objects, if any, in which the JWS was nested. The last item in the list is the outer most JOSE object (not including the current JWS).
      Returns:
      the signature or MAC verification key
      Throws:
      UnresolvableKeyException - if no appropriate key can be found
    • setDisambiguateWithVerifySignature

      public void setDisambiguateWithVerifySignature(boolean disambiguateWithVerifySignature)
      Indicates whether or not to use signature verification to try and disambiguate when the normal key selection based on the JWS headers results in more than one key. Default is false.
      Parameters:
      disambiguateWithVerifySignature - boolean indicating whether or not to use signature verification to disambiguate