Code example for X509Certificate

Methods: getSubjectX500Principal

0
     */ 
    public void test_getPeerPrincipal() throws Exception { 
        Principal p1 = clientSession.getPeerPrincipal();
        KeyStore store = server.getStore();
        X509Certificate cert = (X509Certificate)store.getCertificate("mykey");
        Principal p2 = cert.getSubjectX500Principal();
        assertEquals(p1, p2);
    } 
 
    /** 
     * javax.net.ssl.SSLSession#getApplicationBufferSize() 
     */ 
    public void test_getApplicationBufferSize() { 
        assertTrue(clientSession.getApplicationBufferSize() > 0);
    } 
 
    /** 
     * javax.net.ssl.SSLSession#getCipherSuite() 
     */ 
    public void test_getCipherSuite() { 
        assertEquals(CIPHER_SUITE, clientSession.getCipherSuite());