コード例 #1
0
ファイル: frmCryptoModeSelect.cs プロジェクト: AyrA/CryptoPad
 private void btnRsaSelect_Click(object sender, EventArgs e)
 {
     using (var F = new frmRSASelect(Settings.LoadRSAKeys(), true, RsaKey))
     {
         if (F.ShowDialog() == DialogResult.OK)
         {
             cbRSA.Checked = true;
             RsaKey        = F.SelectedKey;
             if (RsaKey == null)
             {
                 lblRsaName.Text = "<No key selected>";
                 cbRSA.Checked   = false;
             }
             else
             {
                 lblRsaName.Text = RsaKey.Name;
                 if (!RSAEncryption.HasPrivateKey(RsaKey.Key))
                 {
                     Program.AlertMsg(
                         "You picked a key that can only encrypt, not decrypt. " +
                         "You will not be able to open the file again once you close it.\r\n" +
                         "You should only do this if you're encrypting the file for someone else.");
                 }
             }
         }
         Settings.SaveRSAKeys(F.AllKeys, true);
     }
 }
コード例 #2
0
ファイル: frmCryptoInput.cs プロジェクト: nondejus/CryptoPad
 private void btnRSA_Click(object sender, EventArgs e)
 {
     using (var F = new frmRSASelect(RsaKeys, false, RsaKey))
     {
         if (F.ShowDialog() == DialogResult.OK)
         {
             cbRSA.Checked   = true;
             RsaKey          = F.SelectedKey;
             lblRSAName.Text = RsaKey.Name;
         }
     }
 }