org.opends.server.extensions
Class FileBasedKeyManagerProvider

java.lang.Object
  extended by org.opends.server.api.KeyManagerProvider<FileBasedKeyManagerProviderCfg>
      extended by org.opends.server.extensions.FileBasedKeyManagerProvider
All Implemented Interfaces:
ConfigurationChangeListener<FileBasedKeyManagerProviderCfg>

public 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.


Constructor Summary
FileBasedKeyManagerProvider()
          Creates a new instance of this file-based key manager provider.
 
Method Summary
 ConfigChangeResult applyConfigurationChange(FileBasedKeyManagerProviderCfg configuration)
          Applies the configuration changes to this change listener.
 void finalizeKeyManagerProvider()
          Performs any finalization that may be necessary for this key manager provider.
 javax.net.ssl.KeyManager[] getKeyManagers()
          Retrieves a set of KeyManager objects that may be used for interactions requiring access to a key manager.
 void initializeKeyManagerProvider(FileBasedKeyManagerProviderCfg configuration)
          Initializes this key manager provider based on the information in the provided key manager provider configuration.
 boolean isConfigurationAcceptable(FileBasedKeyManagerProviderCfg configuration, java.util.List<Message> unacceptableReasons)
          Indicates whether the provided configuration is acceptable for this key manager provider.
 boolean isConfigurationChangeAcceptable(FileBasedKeyManagerProviderCfg configuration, java.util.List<Message> unacceptableReasons)
          Indicates whether the proposed change to the configuration is acceptable to this change listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileBasedKeyManagerProvider

public FileBasedKeyManagerProvider()
Creates a new instance of this file-based key manager provider. The initializeKeyManagerProvider method must be called on the resulting object before it may be used.

Method Detail

initializeKeyManagerProvider

public void initializeKeyManagerProvider(FileBasedKeyManagerProviderCfg configuration)
                                  throws ConfigException,
                                         InitializationException
Initializes this key manager provider based on the information in the provided key manager provider configuration.

Specified by:
initializeKeyManagerProvider in class KeyManagerProvider<FileBasedKeyManagerProviderCfg>
Parameters:
configuration - The key manager provider configuration that contains the information to use to initialize this key manager provider.
Throws:
ConfigException - If an unrecoverable problem arises in the process of performing the initialization as a result of the server configuration.
InitializationException - If a problem occurs during initialization that is not related to the server configuration.

finalizeKeyManagerProvider

public void finalizeKeyManagerProvider()
Performs any finalization that may be necessary for this key manager provider.

Specified by:
finalizeKeyManagerProvider in class KeyManagerProvider<FileBasedKeyManagerProviderCfg>

getKeyManagers

public javax.net.ssl.KeyManager[] getKeyManagers()
                                          throws DirectoryException
Retrieves a set of KeyManager objects that may be used for interactions requiring access to a key manager.

Specified by:
getKeyManagers in class KeyManagerProvider<FileBasedKeyManagerProviderCfg>
Returns:
A set of KeyManager objects that may be used for interactions requiring access to a key manager.
Throws:
DirectoryException - If a problem occurs while attempting to obtain the set of key managers.

isConfigurationAcceptable

public boolean isConfigurationAcceptable(FileBasedKeyManagerProviderCfg configuration,
                                         java.util.List<Message> unacceptableReasons)
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.

Note that implementations which use a subclass of the provided configuration class will likely need to cast the configuration to the appropriate subclass type.

Overrides:
isConfigurationAcceptable in class KeyManagerProvider<FileBasedKeyManagerProviderCfg>
Parameters:
configuration - 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, or false if not.

isConfigurationChangeAcceptable

public boolean isConfigurationChangeAcceptable(FileBasedKeyManagerProviderCfg configuration,
                                               java.util.List<Message> unacceptableReasons)
Indicates whether the proposed change to the configuration is acceptable to this change listener.

Specified by:
isConfigurationChangeAcceptable in interface ConfigurationChangeListener<FileBasedKeyManagerProviderCfg>
Parameters:
configuration - 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, or false if it is not.

applyConfigurationChange

public ConfigChangeResult applyConfigurationChange(FileBasedKeyManagerProviderCfg configuration)
Applies the configuration changes to this change listener.

Specified by:
applyConfigurationChange in interface ConfigurationChangeListener<FileBasedKeyManagerProviderCfg>
Parameters:
configuration - The new configuration containing the changes.
Returns:
Returns information about the result of changing the configuration.