Class CertificateStoreManager
java.lang.Object
org.jivesoftware.openfire.container.BasicModule
org.jivesoftware.openfire.keystore.CertificateStoreManager
- All Implemented Interfaces:
Module
A manager of certificate stores.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbackup()
Creates a backup of all files that back any of the certificate stores.void
destroy()
Destroys the module.static String
The location (relative to OPENFIRE_HOME) of the directory that holds backups for identity stores.static String
The KeyStore type (jks, jceks, pkcs12, etc) for the identity store for connections of a particular type.getTrustStore
(ConnectionType type) static String
The location (relative to OPENFIRE_HOME) of the directory that holds backups for trust stores.static String
The KeyStore type (jks, jceks, pkcs12, etc) for the trust store for connections of a particular type.void
initialize
(XMPPServer server) Initializes the basic module.void
replaceIdentityStore
(ConnectionType type, CertificateStoreConfiguration configuration, boolean createIfAbsent) void
replaceTrustStore
(ConnectionType type, CertificateStoreConfiguration configuration, boolean createIfAbsent) boolean
Checks if Openfire is configured to use the same set of three keystore files for all connection types (one identity store, and two trust stores - one for client-based connections, and one for server/component-based connections).Methods inherited from class org.jivesoftware.openfire.container.BasicModule
getName, start, stop
-
Constructor Details
-
CertificateStoreManager
public CertificateStoreManager() -
CertificateStoreManager
public CertificateStoreManager(boolean disableWatcher)
-
-
Method Details
-
initialize
Description copied from class:BasicModule
Initializes the basic module.
Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.
- Specified by:
initialize
in interfaceModule
- Overrides:
initialize
in classBasicModule
- Parameters:
server
- the server hosting this module.
-
destroy
public void destroy()Description copied from class:BasicModule
Destroys the module.
Does nothing in the basic module.
- Specified by:
destroy
in interfaceModule
- Overrides:
destroy
in classBasicModule
-
getIdentityStore
-
getTrustStore
-
replaceIdentityStore
public void replaceIdentityStore(ConnectionType type, CertificateStoreConfiguration configuration, boolean createIfAbsent) throws CertificateStoreConfigException - Throws:
CertificateStoreConfigException
-
replaceTrustStore
public void replaceTrustStore(ConnectionType type, CertificateStoreConfiguration configuration, boolean createIfAbsent) throws CertificateStoreConfigException - Throws:
CertificateStoreConfigException
-
getIdentityStoreConfiguration
public CertificateStoreConfiguration getIdentityStoreConfiguration(ConnectionType type) throws IOException - Throws:
IOException
-
getTrustStoreConfiguration
public CertificateStoreConfiguration getTrustStoreConfiguration(ConnectionType type) throws IOException - Throws:
IOException
-
backup
Creates a backup of all files that back any of the certificate stores. Each certificate store can be configured to use a distinct file, as well as use a distinct backup location. In practise, there will be a lot of overlap. This implementation creates a backup (by copying the file) for each unique file/backup-location combination in the collection of all certificate stores.- Returns:
- the paths the store was backed up to
- Throws:
IOException
- if the store could not be backed up
-
getTrustStoreType
The KeyStore type (jks, jceks, pkcs12, etc) for the trust store for connections of a particular type.- Parameters:
type
- the connection type- Returns:
- a store type (never null).
- See Also:
-
getIdentityStoreType
The KeyStore type (jks, jceks, pkcs12, etc) for the identity store for connections of a particular type.- Parameters:
type
- the connection type- Returns:
- a store type (never null).
- See Also:
-
getIdentityStoreBackupDirectory
The location (relative to OPENFIRE_HOME) of the directory that holds backups for identity stores.- Parameters:
type
- the connection type- Returns:
- a path (never null).
-
getTrustStoreBackupDirectory
The location (relative to OPENFIRE_HOME) of the directory that holds backups for trust stores.- Parameters:
type
- the connection type- Returns:
- a path (never null).
-
usesDistinctConfigurationForEachType
Checks if Openfire is configured to use the same set of three keystore files for all connection types (one identity store, and two trust stores - one for client-based connections, and one for server/component-based connections). This method will return 'false' when running Openfire without changes to its default keystore configuration. If changes are made to use different keystores for at least one connection type, this method returns 'true'.- Returns:
- true if Openfire is using different keystores based on the type of connection, false when running with the default store configuration.
- Throws:
IOException
- if there was an IO error
-