Code example for X509Certificate

Methods: checkValidity

0
    /** 
     * checkValidity() method testing. 
     */ 
    public void testCheckValidity1() { 
        try { 
            certificate.checkValidity();
            fail("CertificateExpiredException should be thrown.");
        } catch (CertificateNotYetValidException e) {
            fail("Unexpected CertificateNotYetValidException was thrown.");
        } catch (CertificateExpiredException e) {
        } 
    } 
     
    /** 
     * checkValidity(Date date) method testing. 
     */ 
    public void testCheckValidity2() { 
        try { 
            certificate.checkValidity(new Date(3000000000L));
            fail("CertificateExpiredException should be thrown.");
        } catch (CertificateNotYetValidException e) {