private void btnDisassemble_Click(object sender, EventArgs e) { //ASM = new Asymmetric(); ////XmlTextReader xmlRdr = new XmlTextReader( //Asymmetric.PublicKey RSApublicKey = new Asymmetric.PublicKey(); //RSApublicKey.ImportFromXmlFile(""); //Asymmetric.PrivateKey RSAprivateKey = new Asymmetric.PrivateKey(""); //RSAprivateKey.ImportFromXmlFile(""); //string encryptedSigText = HttpUtility.UrlDecode(txtBxSignature.Text.Substring(0,txtBxSignature.Text.IndexOf("decode"))); //byte[] signatureBinary = Convert.FromBase64String(encryptedSigText); //string transmittedHash = ASM.Decrypt(signatureBinary, RSApublicKey); //string nameValuePairText = HttpUtility.UrlDecode(txtBxPayload.Text.Substring(0,txtBxPayload.Text.IndexOf("decode"))); //string transmittedMessage = nameValuePairText + txtBxClientID.Text + txtBxClientID.Text; //Hash hsh = new Hash(Hash.Provider.MD5); //string calculatedHash = hsh.Calculate(transmittedMessage); //if (transmittedHash != transmittedMessage) //{ // // //} //string encryptedSymmetricKeyText = HttpUtility.UrlDecode(txtBxCipher.Text.Substring(0, txtBxCipher.Text.IndexOf("decode"))); //byte[] encryptedSymKeyBinary = Convert.FromBase64String(encryptedSymmetricKeyText); POSTSSO objSSO = new POSTSSO(); objSSO.ClientID = txtBxClientID.Text; objSSO.ServerID = txtBxServerID.Text; objSSO.SenderKeyVersion = txtBxSenderKeyVer.Text; objSSO.ReceiverKeyVersion = txtBxRecieverKeyVer.Text; objSSO.EmployeeID = txtBxEmpID.Text; objSSO.LoginID = txtBxLoginID.Text; objSSO.TransactionID = txtBxTransID.Text; objSSO.AdditionalParameters = txtBxAddParms.Text; objSSO.Payload = txtBxPayload.Text; objSSO.Cipher = txtBxCipher.Text; objSSO.Signature = txtBxSignature.Text; objSSO.DisAssemble(); }
private void btnAssemble_Click(object sender, EventArgs e) { POSTSSO objSSO = new POSTSSO(); objSSO.ClientID = txtBxClientID.Text; objSSO.ServerID = txtBxServerID.Text; objSSO.SenderKeyVersion = txtBxSenderKeyVer.Text; objSSO.ReceiverKeyVersion = txtBxRecieverKeyVer.Text; objSSO.EmployeeID = txtBxEmpID.Text; objSSO.LoginID = txtBxLoginID.Text; objSSO.TransactionID = txtBxTransID.Text; objSSO.AdditionalParameters = txtBxAddParms.Text; objSSO.DoInit(); txtBxPayload.Text = objSSO.Payload; txtBxCipher.Text = objSSO.Cipher; txtBxSignature.Text = objSSO.Signature; }