public void checkValidity(Date date)
      throws CertificateExpiredException, CertificateNotYetValidException {
    if (date.getTime() > this.getNotAfter().getTime()) // for other VM compatibility
    {
      throw new CertificateExpiredException("certificate expired on " + c.getEndDate().getTime());
    }

    if (date.getTime() < this.getNotBefore().getTime()) {
      throw new CertificateNotYetValidException(
          "certificate not valid till " + c.getStartDate().getTime());
    }
  }
 public Date getNotBefore() {
   return c.getStartDate().getDate();
 }