Class SimpleKeyResolver

java.lang.Object
org.jose4j.jwt.consumer.SimpleKeyResolver
All Implemented Interfaces:
DecryptionKeyResolver, VerificationKeyResolver

class SimpleKeyResolver extends Object implements VerificationKeyResolver, DecryptionKeyResolver
  • Field Details

    • key

      private Key key
  • Constructor Details

    • SimpleKeyResolver

      SimpleKeyResolver(Key key)
  • Method Details

    • resolveKey

      public Key resolveKey(JsonWebEncryption jwe, List<JsonWebStructure> nestingContext)
      Description copied from interface: DecryptionKeyResolver
      Choose the key to be used for decryption on the given JWE.
      Specified by:
      resolveKey in interface DecryptionKeyResolver
      Parameters:
      jwe - the JsonWebEncryption that's about to be decrypted
      nestingContext - a list of JOSE objects, if any, in which the JWE was nested. The last item in the list is the outer most JOSE object (not including the current JWE).
      Returns:
      the decryption key
    • resolveKey

      public Key resolveKey(JsonWebSignature jws, List<JsonWebStructure> nestingContext)
      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