Search in sources :

Example 6 with CertificateNotYetValidException

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

the class CertificateNotYetValidExceptionTest method testCertificateNotYetValidException03.

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

Example 7 with CertificateNotYetValidException

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

the class CertificateNotYetValidExceptionTest method testCertificateNotYetValidException01.

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

Example 8 with CertificateNotYetValidException

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

the class X509CertificateTest method testCheckValidity1.

/**
     * checkValidity() method testing.
     * @throws CertificateNotYetValidException
     * @throws CertificateExpiredException
     * @throws java.security.cert.CertificateExpiredException
     * @throws java.security.cert.CertificateNotYetValidException
     */
public void testCheckValidity1() throws CertificateExpiredException, CertificateNotYetValidException, java.security.cert.CertificateExpiredException, java.security.cert.CertificateNotYetValidException {
    if (this.cert == null) {
        // Test can not be applied.
        return;
    }
    Date date = new Date();
    Date nb_date = tbt_cert.getNotBefore();
    Date na_date = tbt_cert.getNotAfter();
    try {
        tbt_cert.checkValidity();
        assertFalse("CertificateExpiredException expected", date.compareTo(na_date) > 0);
        assertFalse("CertificateNotYetValidException expected", date.compareTo(nb_date) < 0);
    } catch (CertificateExpiredException e) {
        assertTrue("Unexpected CertificateExpiredException was thrown", date.compareTo(na_date) > 0);
    } catch (CertificateNotYetValidException e) {
        assertTrue("Unexpected CertificateNotYetValidException was thrown", date.compareTo(nb_date) < 0);
    }
    try {
        tbt_cert.checkValidity();
    } catch (CertificateExpiredException e) {
    // ok
    }
    try {
        cert.checkValidity();
    } catch (java.security.cert.CertificateExpiredException e) {
    // ok
    }
}
Also used : CertificateNotYetValidException(javax.security.cert.CertificateNotYetValidException) CertificateExpiredException(javax.security.cert.CertificateExpiredException) Date(java.util.Date)

Example 9 with CertificateNotYetValidException

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

the class CertificateNotYetValidExceptionTest method testCertificateNotYetValidException03.

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

Aggregations

CertificateNotYetValidException (javax.security.cert.CertificateNotYetValidException)9 Date (java.util.Date)3 CertificateExpiredException (javax.security.cert.CertificateExpiredException)3 Calendar (java.util.Calendar)1 GregorianCalendar (java.util.GregorianCalendar)1