Package org.jose4j.keys.resolvers
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 Summary
Modifier and TypeMethodDescriptionresolveKey
(JsonWebEncryption jwe, List<JsonWebStructure> nestingContext) Choose the key to be used for decryption on the given 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 decryptednestingContext
- 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
-