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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionA credential may be monitored to ensure that it is functional.void
setTestFunction
(Function<ReloadablePkiCredential, Exception> testFunction) Assigns a test function for this credential.Methods inherited from class se.swedenconnect.security.credential.AbstractPkiCredential
afterPropertiesSet, destroy, getCertificate, getCertificateChain, getDefaultName, getName, getPrivateKey, getPublicKey, setCertificate, setCertificate, setCertificateChain, setName, setPrivateKey, setPrivateKey, setPrivateKey, setPublicKey
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.DisposableBean
destroy
Methods inherited from interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
Methods inherited from interface se.swedenconnect.security.credential.PkiCredential
getCertificate, getCertificateChain, getName, getPrivateKey, getPublicKey, init, isHardwareCredential, setCertificate, setCertificateChain
Methods inherited from interface se.swedenconnect.security.credential.ReloadablePkiCredential
reload
-
Constructor Details
-
AbstractReloadablePkiCredential
public AbstractReloadablePkiCredential()Default constructor.
-
-
Method Details
-
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 anException
for test failures andnull
for success.A credential that returns a function should also implement the
ReloadablePkiCredential.reload()
method.- Specified by:
getTestFunction
in interfaceReloadablePkiCredential
- Returns:
- a function for testing the credential, or null if no test function is available
-
setTestFunction
Assigns a test function for this credential.- Parameters:
testFunction
- the function
-