Package org.opends.server.extensions
Class FileBasedKeyManagerProvider
- java.lang.Object
-
- org.opends.server.api.KeyManagerProvider<FileBasedKeyManagerProviderCfg>
-
- org.opends.server.extensions.FileBasedKeyManagerProvider
-
- All Implemented Interfaces:
ConfigurationChangeListener<FileBasedKeyManagerProviderCfg>
public final class FileBasedKeyManagerProvider extends KeyManagerProvider<FileBasedKeyManagerProviderCfg> implements ConfigurationChangeListener<FileBasedKeyManagerProviderCfg>
This class defines a key manager provider that will access keys stored in a file located on the Directory Server filesystem.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opends.server.api.KeyManagerProvider
KeyManagerProvider.CertificateMonitor
-
-
Constructor Summary
Constructors Constructor Description FileBasedKeyManagerProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigChangeResult
applyConfigurationChange(FileBasedKeyManagerProviderCfg cfg)
Applies the configuration changes to this change listener.boolean
containsAtLeastOneKey()
Verifies that the keystore has at least one usable key.protected void
finalizeKeyManagerProviderImpl()
Performs any other finalization actions that may be necessary by this key manager provider implementation.KeyManager[]
getKeyManagers()
Retrieves a set ofKeyManager
objects that may be used for interactions requiring access to a key manager.KeyStore
getKeyStore()
Returns the keystore used by this key manager provider.void
initializeKeyManagerProvider(FileBasedKeyManagerProviderCfg cfg)
Initializes this key manager provider based on the information in the provided key manager provider configuration.boolean
isConfigurationAcceptable(FileBasedKeyManagerProviderCfg cfg, List<LocalizableMessage> unacceptableReasons)
Indicates whether the provided configuration is acceptable for this key manager provider.boolean
isConfigurationChangeAcceptable(FileBasedKeyManagerProviderCfg cfg, List<LocalizableMessage> unacceptableReasons)
Indicates whether the proposed change to the configuration is acceptable to this change listener.-
Methods inherited from class org.opends.server.api.KeyManagerProvider
finalizeKeyManagerProvider, getConfig, getName, getServerContext, registerCertificateMonitorEntries, setConfig, setServerContext, toString
-
-
-
-
Method Detail
-
initializeKeyManagerProvider
public void initializeKeyManagerProvider(FileBasedKeyManagerProviderCfg cfg) throws InitializationException
Description copied from class:KeyManagerProvider
Initializes this key manager provider based on the information in the provided key manager provider configuration.- Specified by:
initializeKeyManagerProvider
in classKeyManagerProvider<FileBasedKeyManagerProviderCfg>
- Parameters:
cfg
- The key manager provider configuration that contains the information to use to initialize this key manager provider.- Throws:
InitializationException
- If a problem occurs during initialization that is not related to the server configuration.
-
finalizeKeyManagerProviderImpl
protected void finalizeKeyManagerProviderImpl()
Description copied from class:KeyManagerProvider
Performs any other finalization actions that may be necessary by this key manager provider implementation.- Specified by:
finalizeKeyManagerProviderImpl
in classKeyManagerProvider<FileBasedKeyManagerProviderCfg>
-
getKeyStore
public KeyStore getKeyStore() throws LdapException
Description copied from class:KeyManagerProvider
Returns the keystore used by this key manager provider.- Specified by:
getKeyStore
in classKeyManagerProvider<FileBasedKeyManagerProviderCfg>
- Returns:
- The
KeyStore
used by this key manager provider. - Throws:
LdapException
- If a problem occurs while attempting to retrieve the keystore.
-
getKeyManagers
public KeyManager[] getKeyManagers() throws LdapException
Description copied from class:KeyManagerProvider
Retrieves a set ofKeyManager
objects that may be used for interactions requiring access to a key manager.- Specified by:
getKeyManagers
in classKeyManagerProvider<FileBasedKeyManagerProviderCfg>
- Returns:
- A set of
KeyManager
objects that may be used for interactions requiring access to a key manager. - Throws:
LdapException
- If a problem occurs while attempting to obtain the set of key managers.
-
containsAtLeastOneKey
public boolean containsAtLeastOneKey()
Description copied from class:KeyManagerProvider
Verifies that the keystore has at least one usable key.- Overrides:
containsAtLeastOneKey
in classKeyManagerProvider<FileBasedKeyManagerProviderCfg>
- Returns:
- true if the keystore has at least one usable key, false otherwise
-
isConfigurationAcceptable
public boolean isConfigurationAcceptable(FileBasedKeyManagerProviderCfg cfg, List<LocalizableMessage> unacceptableReasons)
Description copied from class:KeyManagerProvider
Indicates whether the provided configuration is acceptable for this key manager provider. It should be possible to call this method on an uninitialized key manager provider instance in order to determine whether the key manager provider would be able to use the provided configuration.- Overrides:
isConfigurationAcceptable
in classKeyManagerProvider<FileBasedKeyManagerProviderCfg>
- Parameters:
cfg
- The key manager provider configuration for which to make the determination.unacceptableReasons
- A list that may be used to hold the reasons that the provided configuration is not acceptable.- Returns:
true
if the provided configuration is acceptable for this key manager provider, orfalse
if not.
-
isConfigurationChangeAcceptable
public boolean isConfigurationChangeAcceptable(FileBasedKeyManagerProviderCfg cfg, List<LocalizableMessage> unacceptableReasons)
Description copied from interface:ConfigurationChangeListener
Indicates whether the proposed change to the configuration is acceptable to this change listener.- Specified by:
isConfigurationChangeAcceptable
in interfaceConfigurationChangeListener<FileBasedKeyManagerProviderCfg>
- Parameters:
cfg
- The new configuration containing the changes.unacceptableReasons
- A list that can be used to hold messages about why the provided configuration is not acceptable.- Returns:
- Returns
true
if the proposed change is acceptable, orfalse
if it is not.
-
applyConfigurationChange
public ConfigChangeResult applyConfigurationChange(FileBasedKeyManagerProviderCfg cfg)
Description copied from interface:ConfigurationChangeListener
Applies the configuration changes to this change listener.- Specified by:
applyConfigurationChange
in interfaceConfigurationChangeListener<FileBasedKeyManagerProviderCfg>
- Parameters:
cfg
- The new configuration containing the changes.- Returns:
- Returns information about the result of changing the configuration.
-
-