Skip to content
Snippets Groups Projects
Unverified Commit aa29d066 authored by Tim van Dijen's avatar Tim van Dijen Committed by GitHub
Browse files

Fix type of ->certificate throughout class

parent 31dc7ea7
No related branches found
No related tags found
No related merge requests found
...@@ -31,9 +31,9 @@ class Signer ...@@ -31,9 +31,9 @@ class Signer
private $privateKey = false; private $privateKey = false;
/** /**
* @var string|bool The certificate (as text). * @var string The certificate (as text).
*/ */
private $certificate = false; private $certificate = '';
/** /**
...@@ -201,10 +201,11 @@ class Signer ...@@ -201,10 +201,11 @@ class Signer
throw new \Exception('Could not find certificate file "' . $certFile . '".'); throw new \Exception('Could not find certificate file "' . $certFile . '".');
} }
$this->certificate = file_get_contents($certFile); $cert = file_get_contents($certFile);
if ($this->certificate === false) { if ($cert === false) {
throw new \Exception('Unable to read certificate file "' . $certFile . '".'); throw new \Exception('Unable to read certificate file "' . $certFile . '".');
} }
$this->certificate = $cert;
} }
...@@ -299,10 +300,8 @@ class Signer ...@@ -299,10 +300,8 @@ class Signer
$objXMLSecDSig->sign($this->privateKey); $objXMLSecDSig->sign($this->privateKey);
if ($this->certificate !== false) { // Add the certificate to the signature
// Add the certificate to the signature $objXMLSecDSig->add509Cert($this->certificate, true);
$objXMLSecDSig->add509Cert($this->certificate, true);
}
// Add extra certificates // Add extra certificates
foreach ($this->extraCertificates as $certificate) { foreach ($this->extraCertificates as $certificate) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment