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; }); }
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); } }); }
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"); } }
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"); } }
void CreatePrivateKey() { MiscUtilsService.CheckedExec(delegate() { VMCAKeyPair.Create(256); }); }