|
12 | 12 | class SimpleSAML_XML_Signer { |
13 | 13 |
|
14 | 14 |
|
15 | | - /** |
16 | | - * The path to the simpleSAMLphp cert dir. |
17 | | - */ |
18 | | - private static $certDir = FALSE; |
19 | | - |
20 | 15 | /** |
21 | 16 | * The name of the ID attribute. |
22 | 17 | */ |
@@ -58,11 +53,6 @@ class SimpleSAML_XML_Signer { |
58 | 53 | public function __construct($options = array()) { |
59 | 54 | assert('is_array($options)'); |
60 | 55 |
|
61 | | - if(self::$certDir === FALSE) { |
62 | | - $config = SimpleSAML_Configuration::getInstance(); |
63 | | - self::$certDir = $config->getPathValue('certdir', 'cert/'); |
64 | | - } |
65 | | - |
66 | 56 | $this->idAttrName = FALSE; |
67 | 57 | $this->privateKey = FALSE; |
68 | 58 | $this->certificate = FALSE; |
@@ -128,7 +118,7 @@ public function loadPrivateKey($file, $pass = NULL) { |
128 | 118 | assert('is_string($file)'); |
129 | 119 | assert('is_string($pass) || is_null($pass)'); |
130 | 120 |
|
131 | | - $keyFile = self::$certDir . $file; |
| 121 | + $keyFile = SimpleSAML_Utilities::resolveCert($file); |
132 | 122 | if (!file_exists($keyFile)) { |
133 | 123 | throw new Exception('Could not find private key file "' . $keyFile . '".'); |
134 | 124 | } |
@@ -178,7 +168,7 @@ public function loadPublicKeyArray($publickey) { |
178 | 168 | public function loadCertificate($file) { |
179 | 169 | assert('is_string($file)'); |
180 | 170 |
|
181 | | - $certFile = self::$certDir . $file; |
| 171 | + $certFile = SimpleSAML_Utilities::resolveCert($file); |
182 | 172 | if (!file_exists($certFile)) { |
183 | 173 | throw new Exception('Could not find certificate file "' . $certFile . '".'); |
184 | 174 | } |
@@ -213,7 +203,7 @@ public function setIDAttribute($idAttrName) { |
213 | 203 | public function addCertificate($file) { |
214 | 204 | assert('is_string($file)'); |
215 | 205 |
|
216 | | - $certFile = self::$certDir . $file; |
| 206 | + $certFile = SimpleSAML_Utilities::resolveCert($file); |
217 | 207 | if (!file_exists($certFile)) { |
218 | 208 | throw new Exception('Could not find extra certificate file "' . $certFile . '".'); |
219 | 209 | } |
|
0 commit comments