private void buttonConfirm_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(textBoxConfirmation.Text) || string.IsNullOrEmpty(textBoxEncKey.Text) || string.IsNullOrEmpty(textBoxPassword.Text) || string.IsNullOrEmpty(textBoxAddress.Text)) { MessageBox.Show(this, "You need to [Generate Key] first.", "knoledge-keychain", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } using (new HourGlass()) { try { BitcoinConfirmationCode confirmationCode = new BitcoinConfirmationCode(textBoxConfirmation.Text, Network.TestNet); BitcoinEncryptedSecretEC encKey = new BitcoinEncryptedSecretEC(textBoxEncKey.Text, Network.TestNet); BitcoinSecret secret = encKey.GetSecret(textBoxPassword.Text); BitcoinAddress address = new BitcoinAddress(textBoxAddress.Text); if (confirmationCode.Check(textBoxPassword.Text, address)) { if (secret.GetAddress() == address) { MessageBox.Show(this, "Confirmation that this Address depends on the Passphrase", "knoledge-keychain", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch (Exception ex) { MessageBox.Show(this, ex.Message, "knoledge-keychain", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }