Class AbstractReloadablePkiCredential

java.lang.Object
se.swedenconnect.security.credential.AbstractPkiCredential
se.swedenconnect.security.credential.AbstractReloadablePkiCredential
All Implemented Interfaces:
DisposableBean, InitializingBean, PkiCredential, ReloadablePkiCredential
Direct Known Subclasses:
KeyStoreCredential, Pkcs11Credential

public abstract class AbstractReloadablePkiCredential extends AbstractPkiCredential implements ReloadablePkiCredential
Abstract base class for reloadable credentials.
Author:
Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
  • Constructor Details

    • AbstractReloadablePkiCredential

      public AbstractReloadablePkiCredential()
      Default constructor.
  • Method Details

    • getTestFunction

      public Supplier<Exception> getTestFunction()
      A credential may be monitored to ensure that it is functional. This can be useful when using for example credentials residing on hardware devices where the connection may be lost. If a credential implementation should be "testable" it must return a function for testing itself. This function (Supplier) returns an Exception for test failures and null for success.

      A credential that returns a function should also implement the ReloadablePkiCredential.reload() method.

      Specified by:
      getTestFunction in interface ReloadablePkiCredential
      Returns:
      a function for testing the credential, or null if no test function is available
    • setTestFunction

      public void setTestFunction(Function<ReloadablePkiCredential,Exception> testFunction)
      Assigns a test function for this credential.
      Parameters:
      testFunction - the function