summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/lib/util.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_encryption/lib/util.php')
-rw-r--r--apps/files_encryption/lib/util.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
index cd46d23108a..8aa926b05f6 100644
--- a/apps/files_encryption/lib/util.php
+++ b/apps/files_encryption/lib/util.php
@@ -289,6 +289,30 @@ class Util {
}
+ public static function changekeypasscode( $oldPassword, $newPassword ) {
+
+ if( \OCP\User::isLoggedIn() ) {
+
+ $key = Keymanager::getPrivateKey( $this->userId, $this->view );
+
+ if ( ( $key = Crypt::symmetricDecryptFileContent( $key, $oldPassword ) ) ) {
+
+ if ( ( $key = Crypt::symmetricEncryptFileContent( $key, $newPassword )) ) {
+
+ Keymanager::setPrivateKey( $key );
+
+ return true;
+
+ }
+
+ }
+
+ }
+
+ return false;
+
+ }
+
public function getPath( $pathName ) {
switch ( $pathName ) {