/// <summary> Сохранить ключ шифрования в локальном хранилище </summary>
        public bool LocalSavePublicKey()
        {
            var modelLogin = DataSourceLogin.GetLastModelLogin();
            var login      = modelLogin.Login;
            var serverArea = modelLogin.ServerAreaCode;
            var secretKey  = DataSourceSecurity.GetUserSecretKey();
            var saveResult = UtilitySecurity.SavePrivateCryptKeyToIsolatedStorage(secretKey, login, serverArea.ToString());

            return(saveResult);
        }
Beispiel #2
0
        /// <summary> Обработчик генерации секретного ключа </summary>
        private void OnSecretKeyGenerated(string login, int serverAreaCode, SecureString secretKey)
        {
            var saveResult = false;

            _currentUserCryptKey = secretKey;

            if (_currentUserCryptKey != null)
            {
                saveResult = UtilitySecurity.SavePrivateCryptKeyToIsolatedStorage(_currentUserCryptKey, login, serverAreaCode.ToString());
            }

            if (saveResult)
            {
                Action action = () =>
                {
                    OnEventViewModel("SecretKeyGenerated");
                };

                CurrentDispatcher.BeginInvoke(action);
            }
        }