public class JSSEX509KeyManager extends javax.net.ssl.X509ExtendedKeyManager implements javax.net.ssl.X509KeyManager, LogoutListener
JSSEX509KeyManager class implements the
javax.net.ssl.X509KeyManager interface.
The javax.net.ssl.X509KeyManager class is used to
initialize an SSLContext object to support X.509
authentication to remote socket peers through JSSE. You can create
an instance of this class either by calling the constructor or by
using the KeyManagerFactory engine.
For details, see the SUN Microsystems API user's guide for the Java Secure Socket Extension (JSSE) version 1.0.2
JSSEX509KeyManagerFactory,
KeyManagerFactory,
SSLContext| Constructor and Description |
|---|
JSSEX509KeyManager(java.security.cert.Certificate[] certChain,
java.security.PrivateKey key)
Creates an instance of the
JSSEX509KeyManager class. |
JSSEX509KeyManager(java.security.KeyStore keyStore)
Creates an instance of the
JSSEX509KeyManager class. |
JSSEX509KeyManager(java.security.KeyStore keyStore,
char[] password)
Creates an instance of the
JSSEX509KeyManager class. |
JSSEX509KeyManager(User user)
Creates a
JSSEX509KeyManager instance that uses an
Entrust User object as the key store. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
chooseClientAlias(java.lang.String[] keyTypes,
java.security.Principal[] issuers,
java.net.Socket socket)
Choose an alias to authenticate the client side of a secure socket given
the public key type and the list of certificate issuer authorities recognized
by the peer (if any).
|
java.lang.String |
chooseEngineClientAlias(java.lang.String[] keyType,
java.security.Principal[] issuers,
javax.net.ssl.SSLEngine engine)
Choose an alias to authenticate the client side of a SSLEngine given
the public key type and the list of certificate issuer authorities recognized
by the peer (if any).
|
java.lang.String |
chooseEngineServerAlias(java.lang.String keyType,
java.security.Principal[] issuers,
javax.net.ssl.SSLEngine engine)
Choose an alias to authenticate the server side of an SSLEngine given
the public key type and the list of certificate issuer authorities recognized
by the peer (if any).
|
java.lang.String |
chooseServerAlias(java.lang.String keyType,
java.security.Principal[] issuers,
java.net.Socket socket)
Choose an alias to authenticate the server side of a secure socket given
the public key type and the list of certificate issuer authorities recognized
by the peer (if any).
|
java.security.cert.X509Certificate[] |
getCertificateChain(java.lang.String name)
Retrieves the certificate chain with the given name.
|
java.lang.String[] |
getClientAliases(java.lang.String keyType,
java.security.Principal[] issuers)
Returns the key type.
|
java.security.PrivateKey |
getPrivateKey(java.lang.String name)
Retrieves the private key with the given name.
|
java.lang.String[] |
getServerAliases(java.lang.String keyType,
java.security.Principal[] issuers)
Returns the key type.
|
void |
logout()
The logout callback function; called from the user when logging out.
|
public JSSEX509KeyManager(java.security.cert.Certificate[] certChain,
java.security.PrivateKey key)
throws java.security.cert.CertificateException
JSSEX509KeyManager class.
certChain - the certificate chainkey - the private keyjava.security.cert.CertificateException - thrown if the certificate chain contains any non-X509
certificatepublic JSSEX509KeyManager(java.security.KeyStore keyStore)
JSSEX509KeyManager class.
keyStore - the key store containing keys and certificatespublic JSSEX509KeyManager(java.security.KeyStore keyStore,
char[] password)
throws java.security.KeyStoreException
JSSEX509KeyManager class.
keyStore - the key store containing keys and certificatespassword, - the password used to protect the KeyStorejava.security.KeyStoreExceptionpublic JSSEX509KeyManager(User user) throws UserNotLoggedInException, java.security.cert.CertificateException, UserFatalException
JSSEX509KeyManager instance that uses an
Entrust User object as the key store. When the user logs out
the keys will no longer be available.user - a logged in Entrust userUserNotLoggedInException - if the user is not logged injava.security.cert.CertificateException - if the certificate chain contains any non-X509 certificatesUserFatalException - if the certificate chain cannot be builtjava.lang.IllegalArgumentException - if the user is not provided (null)public java.lang.String[] getClientAliases(java.lang.String keyType,
java.security.Principal[] issuers)
getClientAliases in interface javax.net.ssl.X509KeyManagerkeyType - ignoredissuers - ignoredpublic java.lang.String[] getServerAliases(java.lang.String keyType,
java.security.Principal[] issuers)
getServerAliases in interface javax.net.ssl.X509KeyManagerkeyType - ignoredissuers - ignoredpublic java.security.cert.X509Certificate[] getCertificateChain(java.lang.String name)
getCertificateChain in interface javax.net.ssl.X509KeyManagername - the name of the certificate to be retrievedpublic java.security.PrivateKey getPrivateKey(java.lang.String name)
getPrivateKey in interface javax.net.ssl.X509KeyManagername - the name of the private key to be retrievedpublic java.lang.String chooseClientAlias(java.lang.String[] keyTypes,
java.security.Principal[] issuers,
java.net.Socket socket)
chooseClientAlias in interface javax.net.ssl.X509KeyManagerkeyTypes - - the key algorithm type name(s), ordered with the most-preferred key type firstissuers - - the list of acceptable CA issuer subject names or null if it does not matter which issuers are used.socket - - the socket to be used for this connection. This parameter is ignored.X509KeyManager.chooseClientAlias(java.lang.String[], java.security.Principal[], java.net.Socket)public java.lang.String chooseServerAlias(java.lang.String keyType,
java.security.Principal[] issuers,
java.net.Socket socket)
chooseServerAlias in interface javax.net.ssl.X509KeyManagerkeyType - - the key algorithm type name.issuers - - the list of acceptable CA issuer subject names or null if it does not matter which issuers are used.socket - - the socket to be used for this connection. This parameter is ignored.X509KeyManager.chooseServerAlias(java.lang.String, java.security.Principal[], java.net.Socket)public java.lang.String chooseEngineClientAlias(java.lang.String[] keyType,
java.security.Principal[] issuers,
javax.net.ssl.SSLEngine engine)
chooseEngineClientAlias in class javax.net.ssl.X509ExtendedKeyManagerkeyTypes - - the key algorithm type name(s), ordered with the most-preferred key type firstissuers - - the list of acceptable CA issuer subject names or null if it does not matter which issuers are used.engine - - the SSLEngine used for this connection. This parameter is ignored.javax.net.ssl.X509KeyManager#chooseEngineClientAliaspublic java.lang.String chooseEngineServerAlias(java.lang.String keyType,
java.security.Principal[] issuers,
javax.net.ssl.SSLEngine engine)
chooseEngineServerAlias in class javax.net.ssl.X509ExtendedKeyManagerkeyType - - the key algorithm type name.issuers - - the list of acceptable CA issuer subject names or null if it does not matter which issuers are used.engine - - the SSLEngine used for this connection. This parameter is ignored.javax.net.ssl.X509KeyManager#chooseEngineServerAliaspublic void logout()
LogoutListenerlogout in interface LogoutListener