private void rsaDecryptButton_Click(object sender, EventArgs e) { try { rsaImpl.rsaCSP.FromXmlString(privateKeyBox.Text); } catch (Exception) { MessageBox.Show("Błędny klucz prywatny", "Błąd", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } string hex = rsaEncryptedTextBytes.Text; byte[] bytes = RsaImpl.StringToByteArray(hex); if (bytes != null) { rsaDecryptText.Text = rsaImpl.decryption(bytes); } }
public Form1() { InitializeComponent(); rsaImpl = new RsaImpl(); }