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.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/private/server.php b/lib/private/server.php
index aab3c82bfeb..86fead1daf1 100644
--- a/lib/private/server.php
+++ b/lib/private/server.php
@@ -9,6 +9,8 @@ use OC\Cache\UserCache;
use OC\DB\ConnectionWrapper;
use OC\Files\Node\Root;
use OC\Files\View;
+use OC\Security\Crypto;
+use OC\Security\SecureRandom;
use OCP\IServerContainer;
/**
@@ -199,6 +201,12 @@ class Server extends SimpleContainer implements IServerContainer {
$this->registerService('Search', function ($c) {
return new Search();
});
+ $this->registerService('SecureRandom', function($c) {
+ return new SecureRandom();
+ });
+ $this->registerService('Crypto', function($c) {
+ return new Crypto();
+ });
$this->registerService('Db', function ($c) {
return new Db();
});
@@ -456,6 +464,24 @@ class Server extends SimpleContainer implements IServerContainer {
}
/**
+ * Returns a SecureRandom instance
+ *
+ * @return \OCP\Security\ISecureRandom
+ */
+ function getSecureRandom() {
+ return $this->query('SecureRandom');
+ }
+
+ /**
+ * Returns a Crypto instance
+ *
+ * @return \OCP\Security\ICrypto
+ */
+ function getCrypto() {
+ return $this->query('Crypto');
+ }
+
+ /**
* Returns an instance of the db facade
*
* @return \OCP\IDb