@@ 219-222 (lines=4) @@ | ||
216 | $message = ''; |
|
217 | ||
218 | // @todo: check writable |
|
219 | if(!empty($privateKeyFile) && is_dir(dirname($privateKeyFile))){ |
|
220 | file_put_contents($privateKeyFile, $keypair->privateKey); |
|
221 | $message .= 'Private key saved to: '.$privateKeyFile.PHP_EOL; |
|
222 | } |
|
223 | ||
224 | if(!empty($publicKeyFile) && is_dir(dirname($publicKeyFile))){ |
|
225 | file_put_contents($publicKeyFile, $keypair->publicKey); |
|
@@ 224-227 (lines=4) @@ | ||
221 | $message .= 'Private key saved to: '.$privateKeyFile.PHP_EOL; |
|
222 | } |
|
223 | ||
224 | if(!empty($publicKeyFile) && is_dir(dirname($publicKeyFile))){ |
|
225 | file_put_contents($publicKeyFile, $keypair->publicKey); |
|
226 | $message .= 'Public key saved to: '.$publicKeyFile.PHP_EOL; |
|
227 | } |
|
228 | ||
229 | return $message.PHP_EOL.'private:'.$keypair->privateKey.PHP_EOL.'public:'.$keypair->publicKey; |
|
230 | } |