private void btnAddPublicKey_Click(object sender, EventArgs e) { string name; using (TextInputDialog dlg = new TextInputDialog("名前の入力", "公開鍵の名前を入力してください")) { if (dlg.ShowDialog() != DialogResult.OK) { return; } name = dlg.InputText; } using (TextInputDialog dlg = new TextInputDialog(name + "の公開鍵", name + "の公開鍵を入力してください", 4)) { if (dlg.ShowDialog() != DialogResult.OK) { return; } try { ECDomainNames domain; byte[] publicKey = ParsePublicKey(dlg.InputText, out domain); ECDSA ecdsa = new ECDSA(domain); ecdsa.Parameters.PublicKey = publicKey; } catch (Exception ex) { MessageBox.Show(ex.Message); return; } _store.AddPublicKeyEntry(name, dlg.InputText); } }
void Rename(KeyEntry entry) { using (TextInputDialog dlg = new TextInputDialog("名前の変更", "名前を変更してOKを押してください")) { dlg.SetDefaultText(entry.Name, true); if (dlg.ShowDialog() == DialogResult.OK) { entry.Name = dlg.InputText; } } }
private void btnRegisterPrivateKey_Click(object sender, EventArgs e) { try { ECDomainNames domain; byte[] privateKey = ParsePrivateKey(txtGeneratedKey.Text, txtGeneratedKeyPass.Text, out domain); ECDSA ecdsa = new ECDSA(domain); ecdsa.Parameters.PrivateKey = privateKey; } catch (Exception ex) { MessageBox.Show(ex.Message); return; } using (TextInputDialog dlg = new TextInputDialog("名前を入力", "秘密鍵の名前を入力してください")) { if (dlg.ShowDialog() == DialogResult.OK) { _store.AddPrivateKeyEntry(dlg.InputText, txtGeneratedKey.Text); } } }
void Rename (KeyEntry entry) { using (TextInputDialog dlg = new TextInputDialog ("名前の変更", "名前を変更してOKを押してください")) { dlg.SetDefaultText (entry.Name, true); if (dlg.ShowDialog () == DialogResult.OK) { entry.Name = dlg.InputText; } } }
private void btnAddPublicKey_Click (object sender, EventArgs e) { string name; using (TextInputDialog dlg = new TextInputDialog ("名前の入力", "公開鍵の名前を入力してください")) { if (dlg.ShowDialog () != DialogResult.OK) return; name = dlg.InputText; } using (TextInputDialog dlg = new TextInputDialog (name + "の公開鍵", name + "の公開鍵を入力してください", 4)) { if (dlg.ShowDialog () != DialogResult.OK) return; try { ECDomainNames domain; byte[] publicKey = ParsePublicKey (dlg.InputText, out domain); ECDSA ecdsa = new ECDSA (domain); ecdsa.Parameters.PublicKey = publicKey; } catch (Exception ex) { MessageBox.Show (ex.Message); return; } _store.AddPublicKeyEntry (name, dlg.InputText); } }
private void btnRegisterPrivateKey_Click (object sender, EventArgs e) { try { ECDomainNames domain; byte[] privateKey = ParsePrivateKey (txtGeneratedKey.Text, txtGeneratedKeyPass.Text, out domain); ECDSA ecdsa = new ECDSA (domain); ecdsa.Parameters.PrivateKey = privateKey; } catch (Exception ex) { MessageBox.Show (ex.Message); return; } using (TextInputDialog dlg = new TextInputDialog ("名前を入力", "秘密鍵の名前を入力してください")) { if (dlg.ShowDialog () == DialogResult.OK) { _store.AddPrivateKeyEntry (dlg.InputText, txtGeneratedKey.Text); } } }