Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
 public Form1()
 {
     InitializeComponent();
     rsaImpl = new RsaImpl();
 }