Example #1
0
        private void OnAssignNewKeysConfirmMsg(AssignNewKeysConfirmMsg msg)
        {
            _logger.Info("assign new keys confirmed --> assing new keys");
            MasterLogin login = _database.GetAll <MasterLogin>().FirstOrDefault();

            if (login != null)
            {
                _logger.Info("assign new keys");
                _cryptographyService.AssignNewKeys();

                login.PublicKey  = _cryptographyService.GetPublicKey();
                login.PrivateKey = _cryptographyService.GetPrivateKeyAsXml();

                _logger.Info("update login with new keys");
                _database.Update(login);
                _logger.Info("login with new keys updated");

                _messenger.Send(new AssignNewKeysSuccsessMsg());
            }
            else
            {
                _logger.Error("login is null!");
            }
        }
        private void OnAssignNewKeysConfirmMsg(AssignNewKeysConfirmMsg msg)
        {
            _logger.Info("assign new keys confirmed --> assing new keys");
            MasterLogin login = _database.GetAll<MasterLogin>().FirstOrDefault();

            if (login != null)
            {
                _logger.Info("assign new keys");
                _cryptographyService.AssignNewKeys();

                login.PublicKey = _cryptographyService.GetPublicKey();
                login.PrivateKey = _cryptographyService.GetPrivateKeyAsXml();

                _logger.Info("update login with new keys");
                _database.Update(login);
                _logger.Info("login with new keys updated");

                _messenger.Send(new AssignNewKeysSuccsessMsg());
            }
            else
            {
                _logger.Error("login is null!");
            }
        }