ice.ssl
Class CertificateEvent

java.lang.Object
  extended byjava.util.EventObject
      extended byice.ssl.CertificateEvent
All Implemented Interfaces:
Serializable

public class CertificateEvent
extends EventObject

An event which indicates that a certificate has been recieved during a SSL transaction. The event is passed to the unique CertificateListener object that registered to receive such events using SSLSocket's setBlockingCertificateListener() static method.

Since:
ICEsecure 1.1
Author:
Jerome Bugnet
See Also:
CertificateListener, CertificateErrorInfo, Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
CertificateEvent(SSLSocket socket, X509Certificate cert, CertificateErrorInfo[] errors)
          Constructs a CertificateEvent object.
 
Method Summary
 X509Certificate getCertificate()
          Returns the server certificate that has been received.
 CertificateErrorInfo[] getErrors()
          Returns an array of Exception objects that indicates all errors found while parsing and verifying the certificate.
 boolean isVerified()
          Indicates wether errors have been found while parsing and verifying the certificate received.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CertificateEvent

public CertificateEvent(SSLSocket socket,
                        X509Certificate cert,
                        CertificateErrorInfo[] errors)
Constructs a CertificateEvent object.

Parameters:
cert - the certificate that has been received
errors - the array of exceptions indicating all errors found while parsing and verifying the certificate
Method Detail

getCertificate

public X509Certificate getCertificate()
Returns the server certificate that has been received.


getErrors

public CertificateErrorInfo[] getErrors()
Returns an array of Exception objects that indicates all errors found while parsing and verifying the certificate.

If the SSLSocket's static method setCertEvents() is set to ALL_CERTIFICATE then the method may return an array of length 0.

If the certificate is corrupted or not understood, a array containing a single CertificateParsingException will be returned.

See Also:
SSLSocket.setCertEvents(int), isVerified()

isVerified

public boolean isVerified()
Indicates wether errors have been found while parsing and verifying the certificate received. If true is returned, then the methiod getErrors() will return an array of length 0.

Returns:
true if the certificate is found to be valid, false otherwise.
See Also:
getErrors()