checkValidity method

bool checkValidity({
  1. DateTime? date,
})

Checks that the given date is within the certificate's validity period.

Implementation

bool checkValidity({DateTime? date}) {
  if (date == null) {
    date = DateTime.now();
  }
  if (notBefore != null && notAfter != null) {
    return date.isAfter(notBefore!) && date.isBefore(notAfter!);
  }
  return false;
}