Search in sources :

Example 1 with CertificateEncodingException

use of javax.security.cert.CertificateEncodingException in project robovm by robovm.

the class CertificateEncodingExceptionTest method testCertificateEncodingException02.

/**
     * Test for <code>CertificateEncodingException(String)</code> constructor
     * Assertion: constructs CertificateEncodingException with detail message
     * msg. Parameter <code>msg</code> is not null.
     */
public void testCertificateEncodingException02() {
    CertificateEncodingException tE;
    for (int i = 0; i < msgs.length; i++) {
        tE = new CertificateEncodingException(msgs[i]);
        assertEquals("getMessage() must return: ".concat(msgs[i]), tE.getMessage(), msgs[i]);
        assertNull("getCause() must return null", tE.getCause());
    }
}
Also used : CertificateEncodingException(javax.security.cert.CertificateEncodingException)

Example 2 with CertificateEncodingException

use of javax.security.cert.CertificateEncodingException in project j2objc by google.

the class CertificateEncodingExceptionTest method testCertificateEncodingException01.

/**
     * Test for <code>CertificateEncodingException()</code> constructor
     * Assertion: constructs CertificateEncodingException with no detail message
     */
public void testCertificateEncodingException01() {
    CertificateEncodingException tE = new CertificateEncodingException();
    assertNull("getMessage() must return null.", tE.getMessage());
    assertNull("getCause() must return null", tE.getCause());
}
Also used : CertificateEncodingException(javax.security.cert.CertificateEncodingException)

Example 3 with CertificateEncodingException

use of javax.security.cert.CertificateEncodingException in project j2objc by google.

the class CertificateEncodingExceptionTest method testCertificateEncodingException03.

/**
     * Test for <code>CertificateEncodingException(String)</code> constructor
     * Assertion: constructs CertificateEncodingException when <code>msg</code>
     * is null
     */
public void testCertificateEncodingException03() {
    String msg = null;
    CertificateEncodingException tE = new CertificateEncodingException(msg);
    assertNull("getMessage() must return null.", tE.getMessage());
    assertNull("getCause() must return null", tE.getCause());
}
Also used : CertificateEncodingException(javax.security.cert.CertificateEncodingException)

Example 4 with CertificateEncodingException

use of javax.security.cert.CertificateEncodingException in project j2objc by google.

the class CertificateEncodingExceptionTest method testCertificateEncodingException02.

/**
     * Test for <code>CertificateEncodingException(String)</code> constructor
     * Assertion: constructs CertificateEncodingException with detail message
     * msg. Parameter <code>msg</code> is not null.
     */
public void testCertificateEncodingException02() {
    CertificateEncodingException tE;
    for (int i = 0; i < msgs.length; i++) {
        tE = new CertificateEncodingException(msgs[i]);
        assertEquals("getMessage() must return: ".concat(msgs[i]), tE.getMessage(), msgs[i]);
        assertNull("getCause() must return null", tE.getCause());
    }
}
Also used : CertificateEncodingException(javax.security.cert.CertificateEncodingException)

Example 5 with CertificateEncodingException

use of javax.security.cert.CertificateEncodingException in project j2objc by google.

the class X509CertificateTest method testGetInstance1.

/**
     * getInstance(InputStream inStream) method testing.
     */
public void testGetInstance1() {
    if (this.cert == null) {
        // Test can not be applied.
        return;
    }
    try {
        ByteArrayInputStream bais = new ByteArrayInputStream(cert.getEncoded());
        X509Certificate.getInstance(bais);
    } catch (java.security.cert.CertificateEncodingException e) {
        fail("Unexpected CertificateEncodingException was thrown.");
    } catch (CertificateEncodingException e) {
        fail("Unexpected CertificateEncodingException was thrown.");
    } catch (CertificateException e) {
    // The requested certificate type is not available.
    // Test pass..
    }
    // Regression for HARMONY-756
    try {
        X509Certificate.getInstance((InputStream) null);
        fail("No expected CertificateException");
    } catch (CertificateException e) {
    // expected;
    }
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) CertificateEncodingException(javax.security.cert.CertificateEncodingException) CertificateException(javax.security.cert.CertificateException)

Aggregations

CertificateEncodingException (javax.security.cert.CertificateEncodingException)9 ByteArrayInputStream (java.io.ByteArrayInputStream)2 CertificateException (javax.security.cert.CertificateException)2 RenegotiationRequiredException (io.undertow.server.RenegotiationRequiredException)1 SSLSessionInfo (io.undertow.server.SSLSessionInfo)1 SSLPeerUnverifiedException (javax.net.ssl.SSLPeerUnverifiedException)1 X509Certificate (javax.security.cert.X509Certificate)1