Class CertificateStore
java.lang.Object
org.jivesoftware.openfire.keystore.CertificateStore
- Direct Known Subclasses:
IdentityStore,TrustStore
A wrapper class for a Java store of certificates, its metadata (password, location) and related functionality.
A subclass of this class exists for each of the two distinct types of key store.
- one that is used to provide credentials, an identity store, in
IdentityStore - one that is used to verify credentials, a trust store, in
TrustStore
- Author:
- Guus der Kinderen, guus.der.kinderen@gmail.com
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CertificateStoreConfigurationprotected static final Providerprotected final KeyStore -
Constructor Summary
ConstructorsConstructorDescriptionCertificateStore(CertificateStoreConfiguration configuration, boolean createIfAbsent) -
Method Summary
Modifier and TypeMethodDescriptionbackup()Copies the file that is the persistent storage for this store to a new file in the backup location.voidDeletes an entry (by entry) in this store.Returns a collection of all x.509 certificates in this store.getStore()voidpersist()Saves the current state of the store to disk.voidreload()Reloads the content of the store from disk.
-
Field Details
-
PROVIDER
-
store
-
configuration
-
-
Constructor Details
-
CertificateStore
public CertificateStore(CertificateStoreConfiguration configuration, boolean createIfAbsent) throws CertificateStoreConfigException - Throws:
CertificateStoreConfigException
-
-
Method Details
-
reload
Reloads the content of the store from disk. Useful when the store content has been modified outside of the Openfire process, or when changes that have not been persisted need to be undone.- Throws:
CertificateStoreConfigException- if the store could not be reloaded
-
persist
Saves the current state of the store to disk. Useful when certificates have been added or removed from the store.- Throws:
CertificateStoreConfigException- of the configuration could not be persisted
-
backup
Copies the file that is the persistent storage for this store to a new file in the backup location.- Returns:
- The path in which the backup was created, or null if the creation of the backup failed.
-
getAllCertificates
Returns a collection of all x.509 certificates in this store. Certificates returned by this method can be of any state (eg: invalid, on a revocation list, etc).- Returns:
- A collection (possibly empty, never null) of all certificates in this store, mapped by their alias.
- Throws:
KeyStoreException- if a keystore has not been initialized
-
delete
Deletes an entry (by entry) in this store. All information related to this entry will be removed, including certificates and keys. When the store does not contain an entry that matches the provided alias, this method does nothing.- Parameters:
alias- The alias for which to delete an entry (cannot be null or empty).- Throws:
CertificateStoreConfigException- if the entry could not be deleted
-
getStore
-
getConfiguration
-