Code example for HandshakeCompletedEvent

Methods: getPeerCertificateChain

0
        } 
 
        X509Certificate xc = X509Certificate.getInstance(bis);
        X509Certificate[] xcs = {xc};
        session = new mySSLSession(xcs);
        event = new HandshakeCompletedEvent(socket, session);
 
        X509Certificate[] res = event.getPeerCertificateChain();
        assertEquals(1, res.length);
    } 
 
    /** 
     * @throws IOException 
     * javax.net.ssl.HandshakeCompletedEvent#getPeerCertificates() 
     */ 
    public final void test_getPeerCertificates() throws IOException { 
        mySSLSession session = new mySSLSession("localhost", 1080, null);
        SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket();
        HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, session);
        try { 
            event.getPeerCertificates();