public QueryTransactionStatusResponse QueryTransactionStatus(QueryTransactionStatusRequest requestData) { string strCert = null; //Hashing the password try { string text = requestData.Credentials.Password; string certificate = @"E:\Certs\pegasus.pfx"; X509Certificate2 cert = new X509Certificate2(certificate, "Tingate710", X509KeyStorageFlags.UserKeySet); RSACryptoServiceProvider rsa = (RSACryptoServiceProvider)cert.PrivateKey; // Hash the data SHA1Managed sha1 = new SHA1Managed(); ASCIIEncoding encoding = new ASCIIEncoding(); byte[] data = encoding.GetBytes(text); byte[] hash = sha1.ComputeHash(data); // Sign the hash byte[] digitalCert = rsa.SignHash(hash, CryptoConfig.MapNameToOID("SHA1")); strCert = Convert.ToBase64String(digitalCert); } catch (Exception e) { dh.LogErrorKCB("", "", DateTime.Now, "", "", e.Message, ""); } if (String.IsNullOrEmpty(strCert)) { password = ""; } else { password = strCert; } dh.SaveRequestlog(requestData.PayLoad.ReferenceID, requestData.Credentials.Username, "", password, "VERIFICATION", DateTime.Now); QueryTransactionStatusResponse resp = new QueryTransactionStatusResponse(); try { if (requestData.IsValidRequest()) { resp = bll.QueryTransactionStatus(requestData); } else { resp.Status.StatusCode = "200"; resp.Status.Description = "Successful"; resp.PayLoad.StatusCode = requestData.PegPayStatusCode; resp.PayLoad.Description = requestData.PegPayStatusDescription; } } catch (Exception e) { requestData.PegPayStatusCode = "106"; requestData.PegPayStatusDescription = "GENERAL ERROR AT PEGASUS"; resp.Status.StatusCode = requestData.PegPayStatusCode; resp.Status.Description = requestData.PegPayStatusDescription; //dh.LogError("SendPendingTransactionsToUtility TranId: " + tran.VendorTranId + " : " + e.Message, tran.VendorCode, DateTime.Now, tran.UtilityCompany); } return(resp); }