code: public void checkValidity(Date date)
      throws CertificateExpiredException, CertificateNotYetValidException {
  
          CertificateValidity interval = null;
          try {
              interval = (CertificateValidity)info.get(CertificateValidity.NAME);
          } catch (Exception e) {
              throw new CertificateNotYetValidException("Incorrect validity period");
          }
          if (interval == null)
              throw new CertificateNotYetValidException("Null validity period");
          interval.valid(date);
      }
docs: Checks that the specified date is within the certificate's
  validity period, or basically if the certificate would be
  valid at the specified date/time.
  
  @param date the Date to check against to see if this certificate
  is valid at that date/time.
  
  @exception CertificateExpiredException if the certificate has expired
  with respect to the <code>date</code> supplied.
  @exception CertificateNotYetValidException if the certificate is not
  yet valid with respect to the <code>date</code> supplied.