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
.- Version:
- 2024-04-20
- 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: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.
-