function exportPublicKey($file) { if (!file_put_contents("{$file}.tmp", $this->pub) || !rename("{$file}.tmp", $file)) { throw new Exception(); } }