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 Details

    • 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 be null.
      key - The key to always return. Must not be null.
  • Method Details

    • 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 interface JWSKeySelector<C extends SecurityContext>
      Parameters:
      header - The header of the JWS object. Must not be null.
      context - Optional context, null if not required.
      Returns:
      The key candidates in trial order, empty list if none.