/// <summary> /// 解密 /// </summary> /// <param name="zhdh"></param> /// <param name="pinBlock"></param> /// <param name="nodeNo"></param> /// <returns></returns> public static string Decrypt(string zhdh, string pinBlock, string nodeNo) { string s = "error"; try { XmlHelper xher = setCommPara("E141", nodeNo); xher.UpdateContent(@"/union/body/pinBlock", pinBlock); xher.UpdateContent(@"/union/body/accNo", zhdh); string send = xher.GetXmlDoc().OuterXml; string recv = SendData(send, nodeNo); if (recv.IndexOf("error") != 0) { XmlHelper xher1 = new XmlHelper(recv); if (xher1.ReadByNode(@"/union/head/responseCode") == "000000") { s = xher1.ReadByNode(@"/union/body/plainPin"); } } } catch (Exception e) { LogWrite.WriteLog("账号:[" + zhdh + "],原因:[" + e.Message + "]", "调用加密机【解密】失败", nodeNo); } return(s); }
private static bool checkRecv(string recv) { if (recv.IndexOf("error") == 0) { return(false); } XmlHelper xher1 = new XmlHelper(recv); if (xher1.ReadByNode(@"/union/head/responseCode") == "000000") { return(true); } else { return(false); } }