Exemple #1
0
        private void ButtonConfirmVerifyPw_Click(object sender, EventArgs e)
        {
            MasterPasswordController mpwController = new MasterPasswordController();

            try
            {
                _masterPw = mpwController.HashMasterPassword(textBoxVerifyPw.Text);
                mpwController.VerifyMasterPassword(_masterPw);
                _verify = true;

                //  Bypass the previous connection check as verification succeed
                _previousConnection = true;

                this.Close();
            } catch (InvalidMasterPasswordException error)
            {
                error.ShowErrorMessage();
            }
        }
Exemple #2
0
        private void ButtonConfirmSetPw_Click(object sender, EventArgs e)
        {
            MasterPasswordController mpwController = new MasterPasswordController();

            try
            {
                //  Check if both input for "Password" & "Confirm Password" are the same, if not then error
                mpwController.CheckInputIsSame(textBoxSetPw1.Text, textBoxSetPw2.Text);

                //  Hash the master password
                _masterPw = mpwController.HashMasterPassword(textBoxSetPw1.Text);

                //  Close this form
                _pwSetted = true;
                this.Close();
            }
            catch (InvalidMasterPasswordException error)
            {
                error.ShowErrorMessage();
            }
        }