Code example for CertificateNotYetValidException

0
            notAfter = tbsCert.getValidity().getNotAfter().getTime();
        } 
        long time = date.getTime();
        if (time < notBefore) {
            // BEGIN android-changed 
            throw new CertificateNotYetValidException("current time: " + date
                + ", validation time: " + new Date(notBefore));
            // END android-changed 
        } 
        if (time > notAfter) {
            // BEGIN android-changed 
            throw new CertificateExpiredException("current time: " + date
                + ", expiration time: " + new Date(notAfter));
            // END android-changed 
        } 
    } 
 
    /** 
     * @see java.security.cert.X509Certificate#getVersion() 
     * method documentation for more information. 
     */