Exemplo n.º 1
0
 protected function _writeTmpKeys()
 {
     $ts = time();
     try {
         $this->_privKeyTempFile = $this->config('tmpPath') . DIRECTORY_SEPARATOR . 'NDL-' . $ts . md5($this->_credentials->getPrivateKey()) . '.key';
         @file_put_contents($this->_privKeyTempFile, $this->_credentials->getPrivateKey());
         $this->_pubKeyTempFile = $this->config('tmpPath') . DIRECTORY_SEPARATOR . 'NDL-' . $ts . md5($this->_credentials->getPublicKey()) . '.pub';
         @file_put_contents($this->_pubKeyTempFile, $this->_credentials->getPublicKey());
     } catch (Exception $e) {
         throw new \Exception('Cannot write to tmpPath: ' . $this->tmpPath);
     }
 }