From d95fc4e1e33f2e6fe4664d03bd39aa48f27e0ad8 Mon Sep 17 00:00:00 2001 From: Sam Tuke Date: Mon, 14 Jan 2013 19:07:28 +0000 Subject: Adding sharing support: added new method in Keymanager setShareKey() Added notes in proxy{} and stream{} pointing to share support --- apps/files_encryption/hooks/hooks.php | 44 +++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) (limited to 'apps/files_encryption/hooks') diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php index c2f97247835..ecceae352bc 100644 --- a/apps/files_encryption/hooks/hooks.php +++ b/apps/files_encryption/hooks/hooks.php @@ -121,8 +121,11 @@ class Hooks { if ( isset( $params['properties']['key'] ) ) { - Keymanager::setFileKey( $params['path'], $params['properties']['key'] ); - + $view = new \OC_FilesystemView( '/' ); + $userId = \OCP\User::getUser(); + + Keymanager::setFileKey( $view, $params['path'], $userId, $params['properties']['key'] ); + } else { \OC_Log::write( @@ -138,6 +141,43 @@ class Hooks { } + /** + * @brief + */ + public static function postShared( $params ) { + + // Delete existing catfile + Keymanager::deleteFileKey( ); + + // Generate new catfile and env keys + Crypt::multiKeyEncrypt( $plainContent, $publicKeys ); + + // Save env keys to user folders + + + } + + /** + * @brief + */ + public static function preUnshare( $params ) { + + // Delete existing catfile + + // Generate new catfile and env keys + + // Save env keys to user folders + } + + /** + * @brief + */ + public static function preUnshareAll( $params ) { + + trigger_error( "preUnshareAll" ); + + } + } ?> \ No newline at end of file -- cgit v1.2.3