summaryrefslogtreecommitdiffstats
path: root/lib/private/server.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/server.php')
-rw-r--r--lib/private/server.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/private/server.php b/lib/private/server.php
index fd7a2bea2d1..d5b72000dcf 100644
--- a/lib/private/server.php
+++ b/lib/private/server.php
@@ -45,9 +45,18 @@ class Server extends SimpleContainer implements IServerContainer {
$this->registerService('ContactsManager', function ($c) {
return new ContactsManager();
});
+
$this->registerService('PreviewManager', function (Server $c) {
return new PreviewManager($c->getConfig());
});
+
+ $this->registerService('EncryptionManager', function (Server $c) {
+ return new Encryption\Manager($c->getConfig());
+ });
+
+ $this->registerService('EncryptionKeyStorageFactory', function ($c) {
+ return new Encryption\Keys\Factory();
+ });
$this->registerService('TagMapper', function(Server $c) {
return new TagMapper($c->getDatabaseConnection());
});
@@ -348,6 +357,24 @@ class Server extends SimpleContainer implements IServerContainer {
}
/**
+ * @return \OC\Encryption\Manager
+ */
+ function getEncryptionManager() {
+ return $this->query('EncryptionManager');
+ }
+
+ /**
+ * @param string $encryptionModuleId encryption module ID
+ *
+ * @return \OCP\Encryption\Keys\IStorage
+ */
+ function getEncryptionKeyStorage($encryptionModuleId) {
+ $view = new \OC\Files\View();
+ $util = new \OC\Encryption\Util($view, \OC::$server->getUserManager());
+ return $this->query('EncryptionKeyStorageFactory')->get($encryptionModuleId, $view, $util);
+ }
+
+ /**
* The current request object holding all information about the request
* currently being processed is returned from this method.
* In case the current execution was not initiated by a web request null is returned