public final class J2EEKeyManager extends X509ExtendedKeyManager
| Constructor and Description |
|---|
J2EEKeyManager(X509KeyManager mgr,
String alias) |
| Modifier and Type | Method and Description |
|---|---|
String |
chooseClientAlias(String[] keyType,
Principal[] issuers,
Socket socket)
Choose the client alias that will be used to select the client
certificate for SSL client auth.
|
String |
chooseEngineClientAlias(String[] keyType,
Principal[] issuers,
SSLEngine engine) |
String |
chooseEngineServerAlias(String keyType,
Principal[] issuers,
SSLEngine engine) |
String |
chooseServerAlias(String keyType,
Principal[] issuers,
Socket socket)
Choose the server alias that will be used to select the server
certificate for SSL server auth.
|
static Subject |
doClientLogin(int type,
CallbackHandler jaasHandler)
Perform login on the client side.
|
X509Certificate[] |
getCertificateChain(String alias)
Return the certificate chain for the specified alias.
|
String[] |
getClientAliases(String keyType,
Principal[] issuers)
Return all the available client aliases for the specified key type.
|
PrivateKey |
getPrivateKey(String alias)
Return the private key for the specified alias.
|
String[] |
getServerAliases(String keyType,
Principal[] issuers)
Return all the available server aliases for the specified key type.
|
public J2EEKeyManager(X509KeyManager mgr, String alias)
public String chooseEngineClientAlias(String[] keyType, Principal[] issuers, SSLEngine engine)
chooseEngineClientAlias in class X509ExtendedKeyManagerpublic String chooseEngineServerAlias(String keyType, Principal[] issuers, SSLEngine engine)
chooseEngineServerAlias in class X509ExtendedKeyManagerpublic String chooseClientAlias(String[] keyType, Principal[] issuers, Socket socket)
the - keytypethe - certificate issuers.the - socket used for this connection. This parameter can be null,
in which case the method will return the most generic alias to use.public String chooseServerAlias(String keyType, Principal[] issuers, Socket socket)
the - keytypethe - certificate issuers.the - socket used for this connection. This parameter can be null,
in which case the method will return the most generic alias to use.public X509Certificate[] getCertificateChain(String alias)
the - alias.public String[] getClientAliases(String keyType, Principal[] issuers)
the - keytypethe - certificate issuers.public String[] getServerAliases(String keyType, Principal[] issuers)
the - keytypethe - certificate issuers.public PrivateKey getPrivateKey(String alias)
the - alias.public static Subject doClientLogin(int type, CallbackHandler jaasHandler) throws LoginException
int - type whether it is username_password or
certificate based login.CallbackHandler - the callback handler to gather user information.LoginException - the exception thrown by the callback handler.Copyright © 2017. All rights reserved.