Search in sources :

Example 6 with X509TrustManagerImpl

use of org.apache.harmony.xnet.tests.support.X509TrustManagerImpl in project robovm by robovm.

the class X509TrustManagerTest method test_checkServerTrusted_01.

/**
     * javax.net.ssl.X509TrustManager#checkServerTrusted(X509Certificate[] chain, String authType)
     */
public void test_checkServerTrusted_01() throws Exception {
    X509TrustManagerImpl xtm = new X509TrustManagerImpl();
    X509Certificate[] xcert = null;
    try {
        xtm.checkServerTrusted(xcert, "SSL");
        fail("IllegalArgumentException wasn't thrown");
    } catch (IllegalArgumentException expected) {
    }
    xcert = new X509Certificate[0];
    try {
        xtm.checkServerTrusted(xcert, "SSL");
        fail("IllegalArgumentException wasn't thrown");
    } catch (IllegalArgumentException expected) {
    }
    xcert = setX509Certificate();
    try {
        xtm.checkServerTrusted(xcert, null);
        fail("IllegalArgumentException wasn't thrown");
    } catch (IllegalArgumentException expected) {
    }
    try {
        xtm.checkServerTrusted(xcert, "");
        fail("IllegalArgumentException wasn't thrown");
    } catch (IllegalArgumentException expected) {
    }
}
Also used : X509TrustManagerImpl(org.apache.harmony.xnet.tests.support.X509TrustManagerImpl) X509Certificate(java.security.cert.X509Certificate)

Example 7 with X509TrustManagerImpl

use of org.apache.harmony.xnet.tests.support.X509TrustManagerImpl in project robovm by robovm.

the class X509TrustManagerTest method test_getAcceptedIssuers.

/**
     * javax.net.ssl.X509TrustManager#getAcceptedIssuers()
     */
public void test_getAcceptedIssuers() throws Exception {
    X509TrustManagerImpl xtm = new X509TrustManagerImpl();
    assertNotNull(xtm.getAcceptedIssuers());
}
Also used : X509TrustManagerImpl(org.apache.harmony.xnet.tests.support.X509TrustManagerImpl)

Aggregations

X509TrustManagerImpl (org.apache.harmony.xnet.tests.support.X509TrustManagerImpl)7 X509Certificate (java.security.cert.X509Certificate)6 CertificateException (java.security.cert.CertificateException)2