public class CompositeX509KeyManager extends Object implements X509KeyManager
Wrap multiple key managers to allow more than one keystore to be used.
The first manager passed to the constructor will be preferred.
See SSLContext.init(javax.net.ssl.KeyManager[], javax.net.ssl.TrustManager[], java.security.SecureRandom)
: Only the first instance of a particular key and/or trust manager implementation type in the array is used. (For example, only the first javax.net.ssl.X509KeyManager in the array will be used.)
Constructor and Description |
---|
CompositeX509KeyManager(List<X509KeyManager> keyManagers) |
Modifier and Type | Method and Description |
---|---|
String |
chooseClientAlias(String[] keyType,
Principal[] issuers,
Socket socket) |
String |
chooseServerAlias(String keyType,
Principal[] issuers,
Socket socket) |
X509Certificate[] |
getCertificateChain(String alias) |
String[] |
getClientAliases(String keyType,
Principal[] issuers) |
PrivateKey |
getPrivateKey(String alias) |
String[] |
getServerAliases(String keyType,
Principal[] issuers) |
public CompositeX509KeyManager(List<X509KeyManager> keyManagers)
public String chooseClientAlias(String[] keyType, Principal[] issuers, Socket socket)
chooseClientAlias
in interface X509KeyManager
public String chooseServerAlias(String keyType, Principal[] issuers, Socket socket)
chooseServerAlias
in interface X509KeyManager
public PrivateKey getPrivateKey(String alias)
getPrivateKey
in interface X509KeyManager
public X509Certificate[] getCertificateChain(String alias)
getCertificateChain
in interface X509KeyManager
public String[] getClientAliases(String keyType, Principal[] issuers)
getClientAliases
in interface X509KeyManager
public String[] getServerAliases(String keyType, Principal[] issuers)
getServerAliases
in interface X509KeyManager