Key manager control of X.509 certificate identities
The role of a JSSE (JSSE) key manager is to retrieve the certificate used to identify the client or server during an SSL handshake.
WAS provides a default key manager that can select a certificate from a keystore when you define the following SSL configuration properties:
These two properties are set automatically when you use the admin console because the default key manager is already configured.
- Defines the alias that is chosen from the keystore for the client side of a connection. This alias must be present in the keystore.
- Defines the alias that is chosen from the keystore for the server side of a connection. This alias must be present in the keystore.
With WAS, we can configure only one key manager at a time for a given SSL configuration. If we want custom certificate selection logic on the client side, write a new custom key manager. The custom key manager could provide function that prompts the user to choose a certificate dynamically. Also, we can implement an extended interface so that a key manager can provide information during connection time.
See on the extended interface, see the com.ibm.wsspi.ssl.KeyManagerExtendedInfo interface.
See on custom key manager development, see Example: Developing a custom key manager for custom SSL key selection.
Default IbmX509 key manager
The default IbmX509 key manager chooses a certificate to serve as the identity for an SSL handshake. The key manager is called to enable client authentication on either side of the SSL handshake; frequently on the server-side, and less frequently on the client side according to client and server requirements. If a keystore is not configured on the client-side and SSL client authentication is enabled, the key manager cannot select a certificate to send to the server. Therefore, the handshake fails.
The following sample code shows the key manager configuration in security.xml for an IbmX509 key manager.<keyManagers xmi:id="KeyManager_1" name="IbmX509" provider="IBMJSSE2" algorithm="IbmX509" keyManagerClass="" managementScope="ManagementScope_1"/>You do not specify the keyManagerClass class because the key manager is provided by the IBMJSSE2 provider. However, we can specify whether the key manager is a custom class implementation, in which case specify the keyManager class, or an algorithm name that WAS can start from the Java security provider framework.
Custom key manager
The following sample code shows the key manager configuration in security.xml for a custom class.<keyManagers xmi:id="KeyManager_2" name="CustomKeyManager" keyManagerClass="com.ibm.ws.ssl.core.CustomKeyManager" managementScope="ManagementScope_1"/>The custom class must implement the javax.net.ssl.X509KeyManager interface and, optionally, implement the com.ibm.wsspi.ssl.KeyManagerExtendedInfo interface to retrieve additional WAS information. This interface replaces the function of the default key manager because we can configure only one key manager at a time. Therefore, the custom key manager has sole responsibility for selecting the alias to use from the configured keystore. The benefit of a custom key manager is its ability, on the client side, to prompt for an alias. This process enables the user to decide which certificate to use in situations where the user knows the client certificate identity.
See Create a custom key manager for SSL.
Create a custom key manager for SSL
Example: Developing a custom key manager for custom SSL key selection