diff options
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/encryption/exceptions/genericencryptionexception.php | 34 | ||||
-rw-r--r-- | lib/public/encryption/ifile.php | 36 | ||||
-rw-r--r-- | lib/public/encryption/imanager.php | 4 | ||||
-rw-r--r-- | lib/public/encryption/keys/istorage.php | 16 | ||||
-rw-r--r-- | lib/public/iservercontainer.php | 25 | ||||
-rw-r--r-- | lib/public/util.php | 17 |
6 files changed, 121 insertions, 11 deletions
diff --git a/lib/public/encryption/exceptions/genericencryptionexception.php b/lib/public/encryption/exceptions/genericencryptionexception.php new file mode 100644 index 00000000000..b7addd3b0c1 --- /dev/null +++ b/lib/public/encryption/exceptions/genericencryptionexception.php @@ -0,0 +1,34 @@ +<?php + /** + * @author Clark Tomlinson <clark@owncloud.com> + * @since 2/25/15, 9:30 AM + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OCP\Encryption\Exceptions; + + +class GenericEncryptionException extends \Exception { + + public function __construct($message = "", $code = 0, \Exception $previous = null) { + if (empty($message)) { + $message = 'Unspecified encryption exception'; + } + parent::__construct($message, $code, $previous); + } + +} diff --git a/lib/public/encryption/ifile.php b/lib/public/encryption/ifile.php new file mode 100644 index 00000000000..464f41509d2 --- /dev/null +++ b/lib/public/encryption/ifile.php @@ -0,0 +1,36 @@ +<?php + +/** + * ownCloud + * + * @copyright (C) 2015 ownCloud, Inc. + * + * @author Bjoern Schiessle <schiessle@owncloud.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this library. If not, see <http://www.gnu.org/licenses/>. + */ + +namespace OCP\Encryption; + +interface IFile { + + /** + * get list of users with access to the file + * + * @param string $path to the file + * @return array + */ + public function getAccessList($path); + +} diff --git a/lib/public/encryption/imanager.php b/lib/public/encryption/imanager.php index 9a12e401593..2691604ac37 100644 --- a/lib/public/encryption/imanager.php +++ b/lib/public/encryption/imanager.php @@ -22,9 +22,7 @@ */ namespace OCP\Encryption; -// -// TODO: move exceptions to OCP -// + use OC\Encryption\Exceptions\ModuleDoesNotExistsException; use OC\Encryption\Exceptions\ModuleAlreadyExistsException; diff --git a/lib/public/encryption/keys/istorage.php b/lib/public/encryption/keys/istorage.php index 4c2b01f4ad0..2d1672face5 100644 --- a/lib/public/encryption/keys/istorage.php +++ b/lib/public/encryption/keys/istorage.php @@ -122,4 +122,20 @@ interface IStorage { */ public function deleteSystemUserKey($keyId); + /** + * copy keys if a file was renamed + * + * @param string $source + * @param string $target + */ + public function renameKeys($source, $target); + + /** + * move keys if a file was renamed + * + * @param string $source + * @param string $target + */ + public function copyKeys($source, $target); + } diff --git a/lib/public/iservercontainer.php b/lib/public/iservercontainer.php index d7df884adf8..509e5894d47 100644 --- a/lib/public/iservercontainer.php +++ b/lib/public/iservercontainer.php @@ -150,13 +150,19 @@ interface IServerContainer { function getHasher(); /** + * Returns a SecureRandom instance + * + * @return \OCP\Security\ISecureRandom + */ + function getSecureRandom(); + + /** * Returns an instance of the db facade * @deprecated use getDatabaseConnection, will be removed in ownCloud 10 * @return \OCP\IDb */ function getDb(); - /** * Returns the app config manager * @@ -173,6 +179,23 @@ interface IServerContainer { function getL10N($app, $lang = null); /** + * @return \OC\Encryption\Manager + */ + function getEncryptionManager(); + + /** + * @return \OC\Encryption\File + */ + function getEncryptionFilesHelper(); + + /** + * @param string $encryptionModuleId encryption module ID + * + * @return \OCP\Encryption\Keys\IStorage + */ + function getEncryptionKeyStorage($encryptionModuleId); + + /** * Returns the URL generator * * @return \OCP\IURLGenerator diff --git a/lib/public/util.php b/lib/public/util.php index b50ce54839b..721bcaadb62 100644 --- a/lib/public/util.php +++ b/lib/public/util.php @@ -219,9 +219,11 @@ class Util { /** * check if some encrypted files are stored * @return bool + * + * @deprecated No longer required */ public static function encryptedFiles() { - return \OC_Util::encryptedFiles(); + return false; } /** @@ -392,18 +394,19 @@ class Util { /** * connects a function to a hook - * @param string $signalclass class name of emitter - * @param string $signalname name of signal - * @param string $slotclass class name of slot - * @param string $slotname name of slot + * + * @param string $signalClass class name of emitter + * @param string $signalName name of signal + * @param string|object $slotClass class name of slot + * @param string $slotName name of slot * @return bool * * This function makes it very easy to connect to use hooks. * * TODO: write example */ - static public function connectHook( $signalclass, $signalname, $slotclass, $slotname ) { - return(\OC_Hook::connect( $signalclass, $signalname, $slotclass, $slotname )); + static public function connectHook($signalClass, $signalName, $slotClass, $slotName ) { + return(\OC_Hook::connect($signalClass, $signalName, $slotClass, $slotName )); } /** |