imanager.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. /**
  3. * @author Björn Schießle <schiessle@owncloud.com>
  4. *
  5. * @copyright Copyright (c) 2015, ownCloud, Inc.
  6. * @license AGPL-3.0
  7. *
  8. * This code is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU Affero General Public License, version 3,
  10. * as published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU Affero General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Affero General Public License, version 3,
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>
  19. *
  20. */
  21. namespace OCP\Encryption;
  22. use OC\Encryption\Exceptions\ModuleDoesNotExistsException;
  23. use OC\Encryption\Exceptions\ModuleAlreadyExistsException;
  24. /**
  25. * This class provides access to files encryption apps.
  26. *
  27. */
  28. interface IManager {
  29. /**
  30. * Check if encryption is available (at least one encryption module needs to be enabled)
  31. *
  32. * @return bool true if enabled, false if not
  33. */
  34. function isEnabled();
  35. /**
  36. * Registers an encryption module
  37. *
  38. * @param IEncryptionModule $module
  39. * @throws ModuleAlreadyExistsException
  40. */
  41. function registerEncryptionModule(IEncryptionModule $module);
  42. /**
  43. * Unregisters an encryption module
  44. *
  45. * @param IEncryptionModule $module
  46. */
  47. function unregisterEncryptionModule(IEncryptionModule $module);
  48. /**
  49. * get a list of all encryption modules
  50. *
  51. * @return array
  52. */
  53. function getEncryptionModules();
  54. /**
  55. * get a specific encryption module
  56. *
  57. * @param string $moduleId
  58. * @return IEncryptionModule
  59. * @throws ModuleDoesNotExistsException
  60. */
  61. function getEncryptionModule($moduleId);
  62. /**
  63. * get default encryption module
  64. *
  65. * @return \OCP\Encryption\IEncryptionModule
  66. * @throws Exceptions\ModuleDoesNotExistsException
  67. */
  68. public function getDefaultEncryptionModule();
  69. /**
  70. * set default encryption module Id
  71. *
  72. * @param string $moduleId
  73. * @return string
  74. */
  75. public function setDefaultEncryptionModule($moduleId);
  76. }