Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
 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;
         }
     }
 }