/// <summary> /// 获取工商银行验证信息 /// </summary> /// <param name="argIcbc"></param> /// <returns></returns> public static MobileICBC GetCheckReturnInfo(MobileICBC argIcbc) { string strMerSignMsg = string.Empty; B2CUtil icbcObj = new B2CUtil(); if (icbcObj.init(strCertFN, strCertFNM, strKeyFN, strKey) == 0) { argIcbc.TranData = Common.Decode(argIcbc.TranData); //判断验证银行签名是否成功 if (icbcObj.verifySignC(argIcbc.TranData, argIcbc.TranData.Length, argIcbc.MerSignMsg, argIcbc.MerSignMsg.Length) == 0) { argIcbc.IsCheck = true; } else argIcbc.IsCheck = true; } else { argIcbc.IsCheck = false; } return argIcbc; }
/// <summary> /// 获取工商银行验证信息 /// </summary> /// <param name="argIcbc"></param> /// <returns></returns> public static MobileICBC GetCheckInfo(MobileICBC argIcbc) { string strMerSignMsg = string.Empty; B2CUtil icbcObj = new B2CUtil(); int jg = icbcObj.init(strCertFN, strCertFNM, strKeyFN, strKey); if (jg == 0) { argIcbc.MerSignMsg = icbcObj.signC(argIcbc.TranData, argIcbc.TranData.Length); if (argIcbc.MerSignMsg == "") { int returnCode = icbcObj.getRC(); //("错误编码:" + returnCode + ",签名错误"); } argIcbc.MerCert = icbcObj.getCert(1); byte[] bytes = Encoding.Default.GetBytes(argIcbc.TranData); argIcbc.TranData = Convert.ToBase64String(bytes); } else { //(jg.ToString() + ",证书错误或私钥错误编码"); } return argIcbc; }