$res = $this->getOpenSSLPKey();
if (!$res) {
- $log->error("Encryption Library could'nt generate users key-pair for {$this->user->getUID()}",
+ $log->error("Encryption Library couldn't generate users key-pair for {$this->user->getUID()}",
['app' => 'encryption']);
if (openssl_error_string()) {
'privateKey' => $privateKey
];
}
- $log->error('Encryption library couldn\'t export users private key, please check your servers openSSL configuration.' . $this->user->getUID(),
+ $log->error('Encryption library couldn\'t export users private key, please check your servers OpenSSL configuration.' . $this->user->getUID(),
['app' => 'encryption']);
if (openssl_error_string()) {
$log->error('Encryption Library:' . openssl_error_string(),
}
/**
- * Generate a pseudo random 256-bit ASCII key, used as file key
+ * Generate a cryptographically secure pseudo-random base64 encoded 256-bit
+ * ASCII key, used as file key
+ *
* @return string
+ * @throws \Exception
*/
public static function generateFileKey() {
// Generate key
}
/**
- * @param $plainContent
+ * @param string $plainContent
* @param array $keyFiles
* @return array
* @throws MultiKeyEncryptException
* written to the header, in case of a write operation
* or if no additional data is needed return a empty array
*/
- public function begin($path, $user, $header, $accessList) {
+ public function begin($path, $user, array $header, array $accessList) {
if (isset($header['cipher'])) {
$this->cipher = $header['cipher'];
* @param array $accessList who has access to the file contains the key 'users' and 'public'
* @return boolean
*/
- public function update($path, $uid, $accessList) {
+ public function update($path, $uid, array $accessList) {
$fileKey = $this->keyManager->getFileKey($path, $uid);
$publicKeys = array();
foreach ($accessList['users'] as $user) {
* @param array $header contains the header data read from the file
* @param array $accessList who has access to the file contains the key 'users' and 'public'
*
- * $return array $header contain data as key-value pairs which should be
+ * @return array $header contain data as key-value pairs which should be
* written to the header, in case of a write operation
* or if no additional data is needed return a empty array
*/
- public function begin($path, $user, $header, $accessList) {
+ public function begin($path, $user, array $header, array $accessList) {
return array();
}
* @param array $accessList who has access to the file contains the key 'users' and 'public'
* @return boolean
*/
- public function update($path, $uid, $accessList) {
+ public function update($path, $uid, array $accessList) {
return true;
}
}
class GenericEncryptionException extends \Exception {
- public function __construct($message = "", $code = 0, \Exception $previous = null) {
+ /**
+ * @param string $message
+ * @param int $code
+ * @param \Exception $previous
+ */
+ public function __construct($message = '', $code = 0, \Exception $previous = null) {
if (empty($message)) {
$message = 'Unspecified encryption exception';
}
* written to the header, in case of a write operation
* or if no additional data is needed return a empty array
*/
- public function begin($path, $user, $header, $accessList);
+ public function begin($path, $user, array $header, array $accessList);
/**
* last chunk received. This is the place where you can perform some final
* @param array $accessList who has access to the file contains the key 'users' and 'public'
* @return boolean
*/
- public function update($path, $uid, $accessList);
+ public function update($path, $uid, array $accessList);
/**
* should the file be encrypted or not
* get default encryption module
*
* @return \OCP\Encryption\IEncryptionModule
- * @throws Exceptions\ModuleDoesNotExistsException
+ * @throws ModuleDoesNotExistsException
*/
public function getDefaultEncryptionModule();