Exemplo n.º 1
0
 /**
  * Check certificate validity.
  *
  * @param Certificate $cert
  * @throws PathValidationException
  */
 private function _checkValidity(Certificate $cert)
 {
     $refdt = $this->_config->dateTime();
     $validity = $cert->tbsCertificate()->validity();
     if ($validity->notBefore()->dateTime()->diff($refdt)->invert) {
         throw new PathValidationException("Certificate validity period has not started.");
     }
     if ($refdt->diff($validity->notAfter()->dateTime())->invert) {
         throw new PathValidationException("Certificate has expired.");
     }
 }