Class EmbeddedJwkVerificationKeyResolver

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

public class EmbeddedJwkVerificationKeyResolver extends Object implements VerificationKeyResolver
A VerificationKeyResolver implementation that uses the key in the "jwk" JWS header per https://tools.ietf.org/html/rfc7515#section-4.1.3
This Resolver should be used only with great care and only for specific circumstances.
  • Constructor Details

    • EmbeddedJwkVerificationKeyResolver

      public EmbeddedJwkVerificationKeyResolver()
  • 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
    • getJwk

      public PublicJsonWebKey getJwk()
      Gets the JWK that was found in the JWS header by this resolver.
      Returns:
      the JWK