}
// Fetch public keys for all users who will share the file
- $publicKeys = Keymanager::getPublicKeys( $this->view, $uniqueUserIds );
+ $publicKeys = Keymanager::getPublicKeys($this->view, $uniqueUserIds);
// Recrypt data, generate catfile
- $recrypted = Crypt::legacyKeyRecryptKeyfile($legacyData, $legacyPassphrase, $publicKeys, $newPassphrase, $legacyFile['path']);
+ $recrypted = Crypt::legacyKeyRecryptKeyfile( $legacyData, $legacyPassphrase, $publicKeys );
$rawPath = $legacyFile['path'];
- $relPath = $this->stripUserFilesPath( $rawPath );
+ $relPath = $this->stripUserFilesPath($rawPath);
// Save keyfile
- Keymanager::setFileKey( $this->view, $relPath, $this->userId, $recrypted['filekey'] );
+ Keymanager::setFileKey($this->view, $relPath, $this->userId, $recrypted['filekey']);
// Save sharekeys to user folders
- Keymanager::setShareKeys( $this->view, $relPath, $recrypted['sharekeys'] );
+ Keymanager::setShareKeys($this->view, $relPath, $recrypted['sharekeys']);
// Overwrite the existing file with the encrypted one
- $this->view->file_put_contents( $rawPath, $recrypted['data'] );
+ $this->view->file_put_contents($rawPath, $recrypted['data']);
- $size = strlen( $recrypted['data'] );
+ $size = strlen($recrypted['data']);
// Add the file to the cache
- \OC\Files\Filesystem::putFileInfo( $rawPath, array( 'encrypted' => true, 'size' => $size ), '' );
+ \OC\Files\Filesystem::putFileInfo($rawPath, array(
+ 'encrypted' => true,
+ 'size' => $size
+ ), '');
}
}