예제 #1
0
 protected function _validateExpiry()
 {
     if ($this->_certificate->getValidFromUnixTime() > time()) {
         $this->_errors[] = "Entity certificate is not yet valid";
     }
     if ($this->_certificate->getValidUntilUnixTime() < time()) {
         $this->_errors[] = "Entity certificate has expired";
     }
     // Check if the certificate is still valid in x days, add a warning if it is not
     $entityMetadataMinimumValidityUnixTime = time() + $this->_certificateExpiryWarningDays * DAY_IN_SECONDS;
     if (!$this->_certificate->getValidUntilUnixTime() > $entityMetadataMinimumValidityUnixTime) {
         $this->_warnings[] = "Entity certificate will expire in less than {$this->_certificateExpiryWarningDays} days";
     }
 }