diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php
index 505fad440d5d2510432d2e0d98c27d3407d951f1..bc6280ff61bd10ea8bc2ef777c443ac7a9eb5784 100644
--- a/apps/files_encryption/lib/proxy.php
+++ b/apps/files_encryption/lib/proxy.php
@@ -134,7 +134,7 @@ class Proxy extends \OC_FileProxy {
 				
 				$sharingEnabled = \OCP\Share::isEnabled();
 				
-				$uniqueUserIds = $util->getSharingUsersArray( $sharingEnabled, $filePath );
+				$uniqueUserIds = $util->getSharingUsersArray( $sharingEnabled, $filePath, $userId );
 				
 				// Fetch public keys for all users who will share the file
 				$publicKeys = Keymanager::getPublicKeys( $rootView, $uniqueUserIds );
diff --git a/apps/files_encryption/lib/stream.php b/apps/files_encryption/lib/stream.php
index c12fab783b331077f4e78389f3a20d85a8cf0f2c..6fb95934c32be68e337386fbee3cfff4990001c3 100644
--- a/apps/files_encryption/lib/stream.php
+++ b/apps/files_encryption/lib/stream.php
@@ -335,14 +335,10 @@ class Stream {
 		
 		$util = new Util( $this->rootView, $this->userId );
 		
-		// Get all users sharing the file
-		$uniqueUserIds = $util->getSharingUsersArray( $sharingEnabled, $this->relPath );
+		// Get all users sharing the file includes current user
+		$uniqueUserIds = $util->getSharingUsersArray( $sharingEnabled, $this->relPath, $this->userId);
 
-        // allways add current user
-        $uniqueUserIds[] = $this->userId;
-        array_unique( $uniqueUserIds );
-
-		// Fetch public keys for all sharing users
+        // Fetch public keys for all sharing users
 		$publicKeys = Keymanager::getPublicKeys( $this->rootView, $uniqueUserIds );
 
         // Encrypt enc key for all sharing users
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
index b3df7f0db03882872c71af8d3eeacd2f4b604f4b..e69314e099a5be2d59f38b2c92361ff1f2a0c4e0 100644
--- a/apps/files_encryption/lib/util.php
+++ b/apps/files_encryption/lib/util.php
@@ -848,7 +848,7 @@ class Util {
 	 * @brief Find, sanitise and format users sharing a file
 	 * @note This wraps other methods into a portable bundle
 	 */
-	public function getSharingUsersArray( $sharingEnabled, $filePath ) {
+	public function getSharingUsersArray( $sharingEnabled, $filePath, $currentUserId = false ) {
 
 		// Check if key recovery is enabled
 		$recoveryEnabled = $this->recoveryEnabled();
@@ -878,7 +878,12 @@ class Util {
 			$userIds[] = $adminUid;
 			
 		}
-		
+
+        // add current user if given
+        if($currentUserId != false) {
+            $userIds[] = $currentUserId;
+        }
+
 		// Remove duplicate UIDs
 		$uniqueUserIds = array_unique ( $userIds );