Name

X509TrustManager

Synopsis

This interface is a TrustManager for working with X.509 certificates. Trust managers are used during the handshake phase of SSL connection to determine whether the authentication credentials presented by the remote host are trusted. This is usually done on the client-side of an SSL connection, but may also be done on the server side. Obtain an X509TrustManager either by implementing your own or from a TrustManagerFactory that was created to use the “SunX509” algorithm. Applications do call the methods of this interface themselves; instead, they simply provide an appropriate X509TrustManager object to the SSLContext object that is responsible for setting up SSL connections. When the system needs to determine whether the authentication credentials presented by the remote host are trusted, it calls the methods of the trust manager.

javax.net.ssl.X509TrustManager

Figure 18-20. javax.net.ssl.X509TrustManager

public interface X509TrustManager extends TrustManager {
// Public Instance Methods
     void checkClientTrusted(java.security.cert.X509Certificate[ ] chain, 
        String authType) throws java.security.cert.CertificateException;  
     void checkServerTrusted(java.security.cert.X509Certificate[ ] chain, 
        String authType) throws java.security.cert.CertificateException;  
     java.security.cert.X509Certificate[ ] getAcceptedIssuers( );  
}

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.