Package com.nimbusds.jose.proc
Class SingleKeyJWSKeySelector<C extends SecurityContext>
java.lang.Object
com.nimbusds.jose.proc.SingleKeyJWSKeySelector<C>
- All Implemented Interfaces:
JWSKeySelector<C>
public class SingleKeyJWSKeySelector<C extends SecurityContext>
extends Object
implements JWSKeySelector<C>
A
JWSKeySelector that always returns the same Key.- Author:
- Josh Cummings
-
Constructor Summary
ConstructorsConstructorDescriptionSingleKeyJWSKeySelector(JWSAlgorithm expectedJWSAlg, Key key) Creates a new single-key JWS key selector. -
Method Summary
Modifier and TypeMethodDescriptionselectJWSKeys(JWSHeader header, C context) Selects key candidates for verifying a JWS object.
-
Constructor Details
-
SingleKeyJWSKeySelector
Creates a new single-key JWS key selector.- Parameters:
expectedJWSAlg- The expected JWS algorithm for the JWS objects to be verified. Must not benull.key- The key to always return. Must not benull.
-
-
Method Details
-
selectJWSKeys
Description copied from interface:JWSKeySelectorSelects key candidates for verifying a JWS object.- Specified by:
selectJWSKeysin interfaceJWSKeySelector<C extends SecurityContext>- Parameters:
header- The header of the JWS object. Must not benull.context- Optional context of the JWS object,nullif not required.- Returns:
- The key candidates in trial order, empty list if none.
-