Package org.jose4j.keys.resolvers
Class JwksDecryptionKeyResolver
java.lang.Object
org.jose4j.keys.resolvers.JwksDecryptionKeyResolver
- All Implemented Interfaces:
DecryptionKeyResolver
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionresolveKey
(JsonWebEncryption jwe, List<JsonWebStructure> nestingContext) Choose the key to be used for decryption on the given JWE.void
setDisambiguateWithAttemptDecrypt
(boolean disambiguateWithAttemptDecrypt) Indicates whether to try decrypting to disambiguate when the normal key selection based on the JWE headers results in more than one key.
-
Constructor Details
-
JwksDecryptionKeyResolver
-
-
Method Details
-
resolveKey
public Key resolveKey(JsonWebEncryption jwe, List<JsonWebStructure> nestingContext) throws UnresolvableKeyException Description copied from interface:DecryptionKeyResolver
Choose the key to be used for decryption on the given JWE.- Specified by:
resolveKey
in interfaceDecryptionKeyResolver
- 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
-
setDisambiguateWithAttemptDecrypt
public void setDisambiguateWithAttemptDecrypt(boolean disambiguateWithAttemptDecrypt) Indicates whether to try decrypting to disambiguate when the normal key selection based on the JWE headers results in more than one key. Default is false.- Parameters:
disambiguateWithAttemptDecrypt
- boolean indicating whether to use decrypting to disambiguate
-