org.schwering.irc.lib.ssl
Class SSLDefaultTrustManager

java.lang.Object
  extended byorg.schwering.irc.lib.ssl.SSLDefaultTrustManager
All Implemented Interfaces:
SSLTrustManager

public class SSLDefaultTrustManager
extends java.lang.Object
implements SSLTrustManager

The default TrustManager of the SSLIRCConnection.

It automatically accepts the X509 certificate.

In many cases you should change the SSLIRCConnection's SSLTrustManager. For examle if you write an IRC client for human users, you may want to ask the user whether he accepts the server's certificate or not.

Since:
1.10
Version:
2.00
Author:
Christoph Schwering <schwering@gmail.com>
See Also:
SSLIRCConnection, SSLTrustManager

Constructor Summary
SSLDefaultTrustManager()
           
 
Method Summary
 java.security.cert.X509Certificate[] getAcceptedIssuers()
          Returns the accepted certificates.
 boolean isTrusted(java.security.cert.X509Certificate[] chain)
          Trusts the complete certificate chain and returns true.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SSLDefaultTrustManager

public SSLDefaultTrustManager()
Method Detail

isTrusted

public boolean isTrusted(java.security.cert.X509Certificate[] chain)
Trusts the complete certificate chain and returns true.

Specified by:
isTrusted in interface SSLTrustManager
Parameters:
chain - The peer certificate chain.
Returns:
true.

getAcceptedIssuers

public java.security.cert.X509Certificate[] getAcceptedIssuers()
Returns the accepted certificates. They are set in the checkServerTrusted method.

Specified by:
getAcceptedIssuers in interface SSLTrustManager
Returns:
A non-null (possibly empty) array of acceptable CA issuer certificates.