TrustManager Interface
The primary responsibility of the TrustManager is
to determine whether the presented authentication credentials should
be trusted. If the credentials are not trusted, the connection will
be terminated. To authenticate the remote identity of a secure socket
peer, you need to initialize an SSLContext object
with one or more TrustManagers. You need to pass
one TrustManager for each authentication mechanism
that is supported. If null is passed into the SSLContext initialization,
a trust manager will be created for you. Typically, there is a single
trust manager that supports authentication based on X.509 public key
certificates (e.g. X509TrustManager). Some secure
socket implementations may also support authentication based on shared
secret keys, Kerberos, or other mechanisms.
TrustManagers are created either by a TrustManagerFactory,
or by providing a concrete implementation of the interface.