Interface DecryptionKeyResolver

All Known Implementing Classes:
JwksDecryptionKeyResolver

public interface DecryptionKeyResolver
A callback interface for resolving the key (by looking at headers like "kid", for example) to use to decrypt the JWE.
  • Method Details

    • resolveKey

      Key resolveKey(JsonWebEncryption jwe, List<JsonWebStructure> nestingContext) throws UnresolvableKeyException
      Choose the key to be used for decryption on the given JWE.
      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
      Throws:
      UnresolvableKeyException - if no appropriate key can be found