コード例 #1
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            if (KeyNameTextBox.Text != string.Empty)
            {
                key.KeyName = KeyNameTextBox.Text;
            }
            else
            {
                key.KeyName = RSAEncryptor.ValidateKeyName("Chave");
            }

            key.encryptionMode = (Key.EncryptionMode)EncryptionModeDropdown.SelectedItem;

            if (key.encryptionMode == Key.EncryptionMode.Automatic)
            {
                SaveAutomaticKey();
            }
            else
            {
                SaveManualKey();
            }

            KeysTab.UpdateKeysList();
            RSAEncryptor.UpdateKeysList();
        }
コード例 #2
0
        private void AddKeyButton_Click(object sender, EventArgs e)
        {
            string newKeyName = RSAEncryptor.ValidateKeyName("Nova Chave");
            var    key        = new Key();

            key.SetName(newKeyName);
            RSAEncryptor.AddKey(key);

            AddKey(newKeyName);
            KeysList.CurrentCell = KeysList.Rows[KeysList.Rows.Count - 1].Cells[0];

            UpdateItemsSize();
        }