public class LDAPSTrustManager
extends java.lang.Object
implements javax.net.ssl.X509TrustManager
LDAPSTrustManager class implements the
javax.net.ssl.X509TrustManager interface.
The javax.net.ssl.X509TrustManager interface is used
to initialize an SSLContext object to support X.509 authentication
to remote socket peers through JSSE.
This class uses the toolkit's CertVerifier
to validate certificates.
For more information, see the SUN Microsystems API user's guide for the Java Secure Socket Extension (JSSE) version 1.0.2
EntrustSSLSocketFactory,
SSLContext| Constructor and Description |
|---|
LDAPSTrustManager()
Creates an anonymous
LDAPSTrustManager instance. |
LDAPSTrustManager(KeyAndCertContainer keyAndCertContainer)
Creates a
LDAPSTrustManager instance that uses an
Entrust key/certificate container's certificate validation mechanism for
trust decisions. |
LDAPSTrustManager(java.security.cert.X509Certificate[] trustedRoots)
Creates an instance of the
LDAPSTrustManager
class. |
| Modifier and Type | Method and Description |
|---|---|
void |
checkClientTrusted(java.security.cert.X509Certificate[] chain,
java.lang.String authType)
Given the partial or complete certificate chain provided by the peer, build a certificate path to a trusted root and return if it can be validated and is trusted for client SSL authentication based on the authentication type.
|
void |
checkServerTrusted(java.security.cert.X509Certificate[] chain,
java.lang.String authType)
Given the partial or complete certificate chain provided by the peer, build a certificate path to a trusted root and return if it can be validated and is trusted for server SSL authentication based on the authentication type.
|
java.security.cert.X509Certificate[] |
getAcceptedIssuers()
Retrieves the trusted certificates.
|
void |
setAnonymousSSL(boolean anon)
If this setting is enabled, server authentication will not be checked.
|
public LDAPSTrustManager()
LDAPSTrustManager instance.public LDAPSTrustManager(KeyAndCertContainer keyAndCertContainer) throws UserNotLoggedInException, UserFatalException, CertificationRootException, java.security.cert.CertificateException
LDAPSTrustManager instance that uses an
Entrust key/certificate container's certificate validation mechanism for
trust decisions.keyAndCertContainer - an Entrust key/certificate containerUserNotLoggedInException - if the Entrust key/certificate container represents a user
that is not logged inUserFatalExceptionjava.security.cert.CertificateExceptionCertificationRootExceptionjava.lang.IllegalArgumentException - if the key/certificate container is not provided (null)
or does not contain a certificate validation mechanismpublic LDAPSTrustManager(java.security.cert.X509Certificate[] trustedRoots)
LDAPSTrustManager
class.
trustedRoots - the trusted certificatesCertificationRootExceptionjava.security.cert.CertificateExceptionpublic java.security.cert.X509Certificate[] getAcceptedIssuers()
getAcceptedIssuers in interface javax.net.ssl.X509TrustManagerpublic void checkClientTrusted(java.security.cert.X509Certificate[] chain,
java.lang.String authType)
throws java.security.cert.CertificateException
checkClientTrusted in interface javax.net.ssl.X509TrustManagerchain - - the peer certificate chainauthType - - the authentication type based on the client certificatejava.lang.IllegalArgumentException - - if null or zero-length chain is passed in for the chain parameter or if null or zero-length string is passed in for the authType parameterjava.security.cert.CertificateException - - if the certificate chain is not trusted by this TrustManager.X509TrustManager.checkClientTrusted(X509Certificate[], String)public void checkServerTrusted(java.security.cert.X509Certificate[] chain,
java.lang.String authType)
throws java.security.cert.CertificateException
checkServerTrusted in interface javax.net.ssl.X509TrustManagerchain - - the peer certificate chainauthType - - the key exchange algorithm usedjava.lang.IllegalArgumentException - - if null or zero-length chain is passed in for the chain parameter or if null or zero-length string is passed in for the authType parameterjava.security.cert.CertificateException - - if the certificate chain is not trusted by this TrustManager.X509TrustManager.checkServerTrusted(X509Certificate[], String)public void setAnonymousSSL(boolean anon)
anon - A value of true indicates that server authentication will not be checked. A
value of false indicates that server authentication will proceed. The default
setting is false.