Exemplo n.º 1
0
        private void SelectKey_Click(object sender, EventArgs e)
        {
            bool FullKey = false;

            if (SelectKeyDialog.ShowDialog() == DialogResult.OK)
            {
                switch (EncryptType.SelectedItem.ToString())
                {
                case ("RSA"):
                    RSA.GetKey(SelectKeyDialog.FileName);
                    FullKey = RSA.CheckKey();
                    break;

                default:
                    break;
                }
            }
            //If we have the full key then we want to unlock both buttons else just unlock encrypt
            if (FullKey)
            {
                EncryptFile.Enabled = true;
                DecryptFile.Enabled = true;
                KeyWindow.Text      = "Key File (PublicPrivate): " + Path.GetFileName(SelectKeyDialog.FileName);
                Status.Text         = "";
            }
            else
            {
                EncryptFile.Enabled = true;
                DecryptFile.Enabled = false;
                KeyWindow.Text      = "Key File (Public): " + Path.GetFileName(SelectKeyDialog.FileName);
                Status.Text         = "";
            }
            SelectFile.Enabled = true;
            DeleteFile.Enabled = true;
        }
Exemplo n.º 2
0
        private void button_playkey_Click(object sender, EventArgs e)
        {
            var dialog = new SelectKeyDialog(Program.Config["PlayKey"]);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                Program.Config["PlayKey"] = dialog.Result;
                Program.Config.Save();
            }
        }
Exemplo n.º 3
0
        private void button2_Click(object sender, EventArgs e)
        {
            var dialog = new SelectKeyDialog(Program.Config["ProxyKey"]);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                label3.Text = Program.Config["ProxyKey"] = dialog.Result;
                Program.Config.Save();
            }
        }