Пример #1
0
        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);
            }
        }
Пример #2
0
 void Rename(KeyEntry entry)
 {
     using (TextInputDialog dlg = new TextInputDialog("名前の変更", "名前を変更してOKを押してください")) {
         dlg.SetDefaultText(entry.Name, true);
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             entry.Name = dlg.InputText;
         }
     }
 }
Пример #3
0
 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);
         }
     }
 }
Пример #4
0
		void Rename (KeyEntry entry)
		{
			using (TextInputDialog dlg = new TextInputDialog ("名前の変更", "名前を変更してOKを押してください")) {
				dlg.SetDefaultText (entry.Name, true);
				if (dlg.ShowDialog () == DialogResult.OK) {
					entry.Name = dlg.InputText;
				}
			}
		}
Пример #5
0
		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);
			}
		}
Пример #6
0
		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);
				}
			}
		}