public final class ConstrainedVerificationKeyResolver extends Object implements org.jose4j.keys.resolvers.VerificationKeyResolver
VerificationKeyResolver
with ability to add custom Constraint
s.Constructor and Description |
---|
ConstrainedVerificationKeyResolver(org.jose4j.keys.resolvers.VerificationKeyResolver keyResolver,
Collection<Constraint> constraints)
Constructs a new
VerificationKeyResolver with a collection of Constraint . |
Modifier and Type | Method and Description |
---|---|
Key |
resolveKey(org.jose4j.jws.JsonWebSignature jws,
List<org.jose4j.jwx.JsonWebStructure> nestingContext)
Chooses the key to be used for signature verification on the given JWS.
|
public ConstrainedVerificationKeyResolver(org.jose4j.keys.resolvers.VerificationKeyResolver keyResolver, Collection<Constraint> constraints)
VerificationKeyResolver
with a collection of Constraint
.keyResolver
- VerificationKeyResolver
constraints
- Constraint
public Key resolveKey(org.jose4j.jws.JsonWebSignature jws, List<org.jose4j.jwx.JsonWebStructure> nestingContext) throws org.jose4j.lang.UnresolvableKeyException
resolveKey
in interface org.jose4j.keys.resolvers.VerificationKeyResolver
jws
- Signed Json Web TokennestingContext
- a list of JOSE objects, if any, in which the JWS was nested.Key
org.jose4j.lang.UnresolvableKeyException
- if no appropriate key can be found