Ejemplo n.º 1
0
 public function testReadAndWrite()
 {
     $tempManager = \OC::$server->getTempManager();
     $filePath = $tempManager->getTemporaryFile();
     $data = 'SomeDataGeneratedByIntegrityCheck';
     $this->fileAccessHelper->file_put_contents($filePath, $data);
     $this->assertSame($data, $this->fileAccessHelper->file_get_contents($filePath));
 }
Ejemplo n.º 2
0
 /**
  * Write the signature of core
  *
  * @param X509 $certificate
  * @param RSA $rsa
  * @param string $path
  */
 public function writeCoreSignature(X509 $certificate, RSA $rsa, $path)
 {
     $iterator = $this->getFolderIterator($path, $path);
     $hashes = $this->generateHashes($iterator, $path);
     $signatureData = $this->createSignatureData($hashes, $certificate, $rsa);
     $this->fileAccessHelper->file_put_contents($path . '/core/signature.json', json_encode($signatureData, JSON_PRETTY_PRINT));
 }