. */ namespace SP\Core\Crypt; use SP\Core\SessionFactory as CoreSession; /** * Class Session * * @package SP\Core\Crypt */ class Session { /** * Devolver la clave maestra de la sesión * * @return string * @throws \Defuse\Crypto\Exception\CryptoException */ public static function getSessionKey() { return CoreSession::getVault()->getData(); } /** * Guardar la clave maestra en la sesión * * @param $data * @throws \Defuse\Crypto\Exception\CryptoException */ public static function saveSessionKey($data) { $Vault = new Vault(); CoreSession::setVault($Vault->saveData($data)); } /** * Regenerar la clave de sesión * * @throws \Defuse\Crypto\Exception\CryptoException */ public static function reKey() { CoreSession::setVault(CoreSession::getVault()->reKey()); } }