コード例 #1
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            MMCActionHelper.CheckedExec(delegate()
            {
                var data         = VMCAKeyPair.Create((uint)numKeyLength.Value);
                rdoPaste.Checked = true;

                if (MessageBox.Show("Do you want to save the keys created?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    Helper.SaveKeyData(data);
                }

                txtKeyData.Text = data.PrivateKey;
            });
        }
コード例 #2
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            MMCActionHelper.CheckedExec(delegate()
            {
                var keyPair         = VMCAKeyPair.Create((uint)numKeyLength.Value);
                DTO.CreatedDateTime = DateTime.Now;
                DTO.KeyLength       = (int)numKeyLength.Value;
                DTO.PrivateKey      = keyPair.PrivateKey;
                DTO.PublicKey       = keyPair.PublicKey;

                if (MessageBox.Show("Do you want to save the keys created?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    Helper.SaveKeyData(keyPair);
                }
            });
        }
コード例 #3
0
 public void OnClickCreateKey(object sender, EventArgs eventargs)
 {
     if (KeyLength.SelectedValue != null)
     {
         var numKeyLength = KeyLength.SelectedValue.ToString();
         var keyPair      = VMCAKeyPair.Create(Convert.ToUInt32(numKeyLength));
         PrivateKeyTextView.Value = keyPair.PrivateKey;
         ConfirmationDialogController dlg = new ConfirmationDialogController("Do you want to save the Keys?");
         //dlg.ConfirmLabel.StringValue = ;
         int result = (int)NSApplication.SharedApplication.RunModalForWindow(dlg.Window);
         if (result == Constants.DIALOGOK)
         {
             VMCAKeyPairNode.SaveKeyData(keyPair);
         }
     }
     else
     {
         UIErrorHelper.ShowAlert("", "Please enter a value for Key Length");
     }
 }
コード例 #4
0
        public void OnCreateKey(object sender, EventArgs e)
        {
            var numKeyLength = KeyLengthOptions.SelectedValue;

            if (numKeyLength != null)
            {
                var keyPair = VMCAKeyPair.Create(Convert.ToUInt32(numKeyLength.ToString()));
                DTO.CreatedDateTime = DateTime.UtcNow;
                DTO.KeyLength       = (int)Convert.ToUInt32(numKeyLength.ToString());
                DTO.PrivateKey      = keyPair.PrivateKey;
                DTO.PublicKey       = keyPair.PublicKey;

                //TODO -show Save Key options here
                this.Close();
                NSApplication.SharedApplication.StopModalWithCode(Constants.DIALOGOK);
            }
            else
            {
                UIErrorHelper.ShowAlert("", "Please enter a value for Key Length");
            }
        }
コード例 #5
0
 void CreatePrivateKey()
 {
     MiscUtilsService.CheckedExec(delegate() { VMCAKeyPair.Create(256); });
 }