private void button_RoundTrip_Click(object sender, EventArgs e) { try { ///X509Krypto XK = new X509Krypto( "My", "LocalMachine", "339C80283637D69D9D9F0F5FE00970D93CB0A148"); X509Krypto XK = new X509Krypto( StoreName_t.Text, StoreLocation_t.Text, CertThumbprint_t.Text); CipherText_t.Text = XK.Encrypt(ClearText_t.Text); ClearText_t.Text = XK.Decrypt(CipherText_t.Text); } catch(Exception ex) { MessageBox.Show(ex.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void button_Decrypt_Click(object sender, EventArgs e) { X509Krypto XK = new X509Krypto(StoreName_t.Text, StoreLocation_t.Text, CertThumbprint_t.Text); ClearText_t.Text = XK.Decrypt(CipherText_t.Text); }