. * */ namespace OCA\Encryption; /** * Class for handling encryption related session data */ class Session { /** * @brief Sets user id for session and triggers emit * @return bool * */ public function setPrivateKey( $privateKey, $userId ) { $_SESSION['privateKey'] = $privateKey; return true; } /** * @brief Gets user id for session and triggers emit * @returns string $privateKey The user's plaintext private key * */ public function getPrivateKey( $userId ) { if ( isset( $_SESSION['privateKey'] ) && !empty( $_SESSION['privateKey'] ) ) { return $_SESSION['privateKey']; } else { return false; } } }