KeyManager Class

Custom implementation of a X509KeyManager. This class is required to support keystores with multiple SSL certificates. By default, the standard Java X509KeyManager and the SunX509 implementation will pick the first aliases it finds for which there is a private key and a key of the right type for the chosen cipher suite (typically RSA). Instead, this class relies on a map of hostnames and their corresponding IP addresses. When a new SSL request is made, it checks the incoming IP address and finds the corresponding hostname. Then, it tries to find an alias in the keystore that corresponds to the hostname.

Constructors

KeyManager( KeyStore keystore, char[] password, String alias )
KeyManager( KeyStore keystore, char[] password, java.util.HashMap aliases )

Public Methods

chooseEngineServerAlias( String keyType, Principal[] issuers, SSLEngine engine ) returns String
chooseServerAlias( String keyType, Principal[] issuers, Socket socket ) returns String
getPrivateKey( String alias ) returns PrivateKey
getCertificateChain( String alias ) returns X509Certificate[]
getServerAliases( String keyType, Principal[] issuers ) returns String[]
getClientAliases( String keyType, Principal[] issuers ) returns String[]
chooseClientAlias( String keyTypes[], Principal[] issuers, Socket socket ) returns String
chooseEngineClientAlias( String[] strings, Principal[] prncpls, SSLEngine ssle ) returns String