Class DefaultCredentialTestFunction

java.lang.Object
se.swedenconnect.security.credential.monitoring.DefaultCredentialTestFunction
All Implemented Interfaces:
Function<ReloadablePkiCredential,Exception>

public class DefaultCredentialTestFunction extends Object implements Function<ReloadablePkiCredential,Exception>
A default credential test function that tests a credential by getting a private key reference and signs test data using this key. The following key algorithms are supported:
  • RSA - SHA256withRSA is the default algorithm when signing.
  • DSA - SHA256withDSA is the default algorithm when signing.
  • EC - SHA256withECDSA is the default algorithm when signing.
Author:
Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
  • Constructor Details

    • DefaultCredentialTestFunction

      public DefaultCredentialTestFunction()
  • Method Details

    • apply

      public Exception apply(ReloadablePkiCredential credential)
      Specified by:
      apply in interface Function<ReloadablePkiCredential,Exception>
    • setProvider

      public void setProvider(String provider)
      The name for a specific security Provider to use.
      Parameters:
      provider - provider name
    • setRsaSignatureAlgorithm

      public void setRsaSignatureAlgorithm(String rsaSignatureAlgorithm)
      Assigns the RSA signature algorithm to use. Defaults to SHA256withRSA.
      Parameters:
      rsaSignatureAlgorithm - the JCA algorithm name
    • setDsaSignatureAlgorithm

      public void setDsaSignatureAlgorithm(String dsaSignatureAlgorithm)
      Assigns the DSA signature algorithm to use. Defaults to SHA256withDSA.
      Parameters:
      dsaSignatureAlgorithm - the JCA algorithm name
    • setEcSignatureAlgorithm

      public void setEcSignatureAlgorithm(String ecSignatureAlgorithm)
      Assigns the EC signature algorithm to use. Defaults to SHA256withECDSA.
      Parameters:
      ecSignatureAlgorithm - the JCA algorithm name