public boolean isValidOn(final Date date){
  if ((x509Certificate == null) || (date == null)) {
    return false;
  }
  try {
    x509Certificate.checkValidity(date);
    return true;
  }
 catch (  CertificateExpiredException e) {
    return false;
  }
catch (  CertificateNotYetValidException e) {
    return false;
  }
}

public boolean isValidOn ( final Date date ) { if ( ( x509Certificate == null ) || ( date == null ) ) { return false ; } try { x509Certificate . checkValidity ( date ) ; return true ; } catch ( CertificateExpiredException e ) { return false ; } catch ( CertificateNotYetValidException e ) { return false ; } }
checks if the given date is in the validity period of the certificate .
