Example #1
0
 /**
  * Verify certificate signature.
  *
  * @param ValidatorState $state
  * @param Certificate $cert
  * @throws PathValidationException
  */
 private function _verifySignature(ValidatorState $state, Certificate $cert)
 {
     try {
         $valid = $cert->verify($this->_crypto, $state->workingPublicKey());
     } catch (\RuntimeException $e) {
         throw new PathValidationException("Failed to verify signature: " . $e->getMessage(), null, $e);
     }
     if (!$valid) {
         throw new PathValidationException("Certificate signature doesn't match.");
     }
 }