Package com.helger.as2lib.cert
Class CertificateFactory
java.lang.Object
com.helger.as2lib.AbstractDynamicComponent
com.helger.as2lib.cert.AbstractCertificateFactory
com.helger.as2lib.cert.CertificateFactory
- All Implemented Interfaces:
IAliasedCertificateFactory
,ICertificateFactory
,IKeyStoreCertificateFactory
,IStorableCertificateFactory
,IDynamicComponent
@ThreadSafe
public class CertificateFactory
extends AbstractCertificateFactory
implements IStorableCertificateFactory
An implementation of a file-based certificate factory using a custom key
store type. Since v4.6.4 this class is derived from
AbstractCertificateFactory
.- Author:
- Philip Helger
-
Field Summary
Fields inherited from class com.helger.as2lib.cert.AbstractCertificateFactory
ATTR_PASSWORD, ATTR_TYPE, DEFAULT_KEY_STORE_TYPE
Fields inherited from class com.helger.as2lib.AbstractDynamicComponent
m_aRWLock
Fields inherited from interface com.helger.as2lib.cert.IStorableCertificateFactory
DEFAULT_SAVE_CHANGES_TO_FILE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
protected void
onChange()
Custom callback method that is invoked if something changes in the key store.void
Reload the key store from the configured source.void
setFilename
(String sFilename) void
setSaveChangesToFile
(boolean bSaveChangesToFile) Change the behavior if all changes should trigger a saving to the original file.Methods inherited from class com.helger.as2lib.cert.AbstractCertificateFactory
addCertificate, addPrivateKey, clearCertificates, createNewKeyStore, debugLog, equals, getAlias, getCertificate, getCertificate, getCertificates, getKeyStore, getKeyStoreType, getPassword, getPrivateKey, getUnifiedAlias, hashCode, initDynamicComponent, initEmptyKeyStore, internalGetCertificate, isDebugLogEnabled, load, removeCertificate, removeCertificate, save, setDebugLogEnaled, setKeyStore, setKeyStoreType, setKeyStoreType, setPassword
Methods inherited from class com.helger.as2lib.AbstractDynamicComponent
attrs, getAttributeAsIntRequired, getAttributeAsStringRequired, getName, getSession, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.helger.as2lib.cert.ICertificateFactory
getCertificate, getCertificateOrNull, getPrivateKey
Methods inherited from interface com.helger.as2lib.IDynamicComponent
attrs, getName, getSession, initDynamicComponent
Methods inherited from interface com.helger.as2lib.cert.IStorableCertificateFactory
getPassword, load, load, load, save, save, save, setPassword, setPassword
-
Field Details
-
ATTR_FILENAME
- See Also:
-
ATTR_SAVE_CHANGES_TO_FILE
- See Also:
-
-
Constructor Details
-
CertificateFactory
public CertificateFactory()
-
-
Method Details
-
setFilename
- Specified by:
setFilename
in interfaceIStorableCertificateFactory
-
getFilename
- Specified by:
getFilename
in interfaceIStorableCertificateFactory
-
setSaveChangesToFile
public void setSaveChangesToFile(boolean bSaveChangesToFile) Description copied from interface:IStorableCertificateFactory
Change the behavior if all changes should trigger a saving to the original file. The default value isIStorableCertificateFactory.DEFAULT_SAVE_CHANGES_TO_FILE
.- Specified by:
setSaveChangesToFile
in interfaceIStorableCertificateFactory
- Parameters:
bSaveChangesToFile
-true
to enable auto-saving,false
to disable it.
-
isSaveChangesToFile
public boolean isSaveChangesToFile()- Specified by:
isSaveChangesToFile
in interfaceIStorableCertificateFactory
- Returns:
true
if changes to the key store should be persisted back to the original file,false
if not. The default value isIStorableCertificateFactory.DEFAULT_SAVE_CHANGES_TO_FILE
.
-
reinitKeyStore
Description copied from interface:IKeyStoreCertificateFactory
Reload the key store from the configured source.- Specified by:
reinitKeyStore
in interfaceIKeyStoreCertificateFactory
- Throws:
AS2Exception
- in case of error
-
onChange
Custom callback method that is invoked if something changes in the key store. By default the changes are written back to disk.- Overrides:
onChange
in classAbstractCertificateFactory
- Throws:
AS2Exception
- In case saving fails.- See Also:
-