Package org.opends.server.api
Class KeyManagerProvider<T extends KeyManagerProviderCfg>
- java.lang.Object
-
- org.opends.server.api.KeyManagerProvider<T>
-
- Type Parameters:
T- The type of key manager provider configuration handled by this key manager provider implementation.
- Direct Known Subclasses:
FileBasedKeyManagerProvider,LDAPKeyManagerProvider,NullKeyManagerProvider,PKCS11KeyManagerProvider
@PublicAPI(stability=VOLATILE, mayInstantiate=false, mayExtend=true, mayInvoke=true) public abstract class KeyManagerProvider<T extends KeyManagerProviderCfg> extends Object
This class defines an API that may be used to obtain a set ofjavax.net.ssl.KeyManagerobjects for use when performing SSL communication.
-
-
Constructor Summary
Constructors Constructor Description KeyManagerProvider()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleancontainsAtLeastOneKey()Verifies that the keystore has at least one usable key.booleancontainsKeyWithAlias(String alias)Verifies that an alias is defined in the scope of this Key Manager.abstract voidfinalizeKeyManagerProvider()Performs any finalization that may be necessary for this key manager provider.abstract KeyManager[]getKeyManagers()Retrieves a set ofKeyManagerobjects that may be used for interactions requiring access to a key manager.abstract voidinitializeKeyManagerProvider(T configuration)Initializes this key manager provider based on the information in the provided key manager provider configuration.booleanisConfigurationAcceptable(T configuration, List<org.forgerock.i18n.LocalizableMessage> unacceptableReasons)Indicates whether the provided configuration is acceptable for this key manager provider.
-
-
-
Method Detail
-
initializeKeyManagerProvider
public abstract void initializeKeyManagerProvider(T configuration) throws ConfigException, InitializationException
Initializes this key manager provider based on the information in the provided key manager provider configuration.- 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.
-
containsKeyWithAlias
public boolean containsKeyWithAlias(String alias)
Verifies that an alias is defined in the scope of this Key Manager.- Parameters:
alias- The alias to check.- Returns:
- true if the alias exists, false otherwise
-
containsAtLeastOneKey
public boolean containsAtLeastOneKey()
Verifies that the keystore has at least one usable key.- Returns:
- true if the keystore has at least one usable key, false otherwise
-
isConfigurationAcceptable
public boolean isConfigurationAcceptable(T configuration, List<org.forgerock.i18n.LocalizableMessage> 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.- 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:
trueif the provided configuration is acceptable for this key manager provider, orfalseif not.
-
finalizeKeyManagerProvider
public abstract void finalizeKeyManagerProvider()
Performs any finalization that may be necessary for this key manager provider.
-
getKeyManagers
public abstract KeyManager[] getKeyManagers() throws DirectoryException
Retrieves a set ofKeyManagerobjects that may be used for interactions requiring access to a key manager.- Returns:
- A set of
KeyManagerobjects 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.
-
-