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>
AJWSKeySelector
that always returns the sameKey
.- Author:
- Josh Cummings
-
-
Constructor Summary
Constructors Constructor Description SingleKeyJWSKeySelector(JWSAlgorithm expectedJWSAlg, Key key)
Creates a new single-key JWS key selector.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<? extends Key>
selectJWSKeys(JWSHeader header, C context)
Selects key candidates for verifying a JWS object.
-
-
-
Constructor Detail
-
SingleKeyJWSKeySelector
public SingleKeyJWSKeySelector(JWSAlgorithm expectedJWSAlg, Key key)
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 Detail
-
selectJWSKeys
public List<? extends Key> selectJWSKeys(JWSHeader header, C context)
Description copied from interface:JWSKeySelector
Selects key candidates for verifying a JWS object.- Specified by:
selectJWSKeys
in interfaceJWSKeySelector<C extends SecurityContext>
- Parameters:
header
- The header of the JWS object. Must not benull
.context
- Optional context,null
if not required.- Returns:
- The key candidates in trial order, empty list if none.
-
-