Class ClientInformationSignatureSigningParametersResolver

All Implemented Interfaces:
SignatureSigningParametersResolver, Resolver<SignatureSigningParameters,CriteriaSet>

public class ClientInformationSignatureSigningParametersResolver extends BasicSignatureSigningParametersResolver implements SignatureSigningParametersResolver
An implementation of an SignatureSigningParametersResolver that extends the BasicSignatureSigningParametersResolver functionality by adding a configurable lookup strategy for fetching the desired algorithm value from OIDCClientInformation. It is expected to be found from the criteria set.
  • Field Details

    • log

      @Nonnull private final org.slf4j.Logger log
      Class logger.
    • signatureAlgorithmLookupStrategy

      @Nonnull private final Function<OIDCClientInformation,String> signatureAlgorithmLookupStrategy
      A lookup function for the signature algorithm.
    • defaultAlgorithmValue

      @Nullable private final String defaultAlgorithmValue
      The default algorithm value used if lookup strategy returned null.
  • Constructor Details

    • ClientInformationSignatureSigningParametersResolver

      public ClientInformationSignatureSigningParametersResolver(@Nonnull @ParameterName(name="signatureAlgorithmLookupStrategy") Function<OIDCClientInformation,String> strategy, @Nullable @ParameterName(name="defaultAlgorithmValue") String defaultValue)
      Constructor.
      Parameters:
      strategy - a lookup function for the signature algorithm
      defaultValue - the default algorithm value used if lookup strategy returned null
  • Method Details

    • getEffectiveSignatureAlgorithms

      @Nonnull protected List<String> getEffectiveSignatureAlgorithms(@Nonnull CriteriaSet criteria, @Nonnull Predicate<String> includeExcludePredicate)
      Get the effective list of signature algorithm URIs to consider, including application of include/exclude policy.
      Overrides:
      getEffectiveSignatureAlgorithms in class BasicSignatureSigningParametersResolver
      Parameters:
      criteria - the input criteria being evaluated
      includeExcludePredicate - the include/exclude predicate to use
      Returns:
      the list of effective algorithm URIs
    • getClientInformation

      @Nullable protected OIDCClientInformation getClientInformation(@Nonnull CriteriaSet criteria)
      Returns the client information from the given criteria set, if one was found.
      Parameters:
      criteria - the input criteria being evaluated
      Returns:
      the client information if it existed, null otherwise
    • getEffectiveSigningCredentials

      @Nonnull protected List<Credential> getEffectiveSigningCredentials(@Nonnull CriteriaSet criteria)
      Get the effective list of signing credentials to consider. Adds the client secret credential to the list provided by the base-class, if secret is set in the metadata.
      Overrides:
      getEffectiveSigningCredentials in class BasicSignatureSigningParametersResolver
      Parameters:
      criteria - the input criteria being evaluated
      Returns:
      the list of credentials
    • convertIntoListIfEnabled

      @Nonnull protected List<String> convertIntoListIfEnabled(@Nonnull String algorithm, @Nonnull List<String> enabledAlgorithms)
      Returns the given algorithm in a List if it was enabled in the list of enabled algorithms. An empty list is returned if the algorithm was not enabled.
      Parameters:
      algorithm - the algorithm to be checked against the list
      enabledAlgorithms - the list of enabled algorithms
      Returns:
      the given algorithm as list if it was enabled, or an empty list if not