org.schwering.irc.lib.ssl
Class SSLDefaultTrustManager

java.lang.Object
  extended by org.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
See Also:
SSLIRCConnection, SSLTrustManager

Field Summary
protected  java.security.cert.X509Certificate[] accepted
          The X509Certificates which are accepted.
 
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

accepted

protected java.security.cert.X509Certificate[] accepted
The X509Certificates which are accepted.

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.