#include \#include \
#include \#include \
//CICParam类处理程序特定的TLV数据元和程序运行参数 //CTLVApp类主要处理通用的TLV数据元
//CAIDListApp,CCandiateListApp,CRsaApp分别为AID列表,候选列表和RSA算法的应用 class CICParam : public CTLVApp ,public CAIDListApp ,public CCandidateListApp,public CRsaApp {
public: int InitRelatedDataList(CXmlDocumentWrapper XmlDoc); int InitTLVMap(CXmlDocumentWrapper XmlDoc); int InitAIDList(CXmlDocumentWrapper XmlDoc); int DataAuthenticationBefore(); int GetICPKInfo(BYTE *ucICPK,USHORT *usICPKLen); int VerifySignedSAD(); int GetIssuerPKInfo(); int SDA(); void DestoryCAPKList(); int InitCAPKList(CXmlDocumentWrapper XmlDoc); int GetCAPKInfo(BYTE ucCAPKIndex,BYTE *ucRIDBuf); int ParseGenerateAC(BYTE *pDataBuf, USHORT usDataBufLen); int SetARC(char *ucARC); int GetTLVListData(CList
CString strLog; int InitSysParam(CXmlDocumentWrapper XmlDoc); int InitTerminalParms(CXmlDocumentWrapper XmlDoc); BOOL SupportCashBack(BYTE ucTransType); BOOL SupportCash(BYTE ucTransType); BOOL SameCurrencyCode(); BOOL AttendedTerminal(); };
#endif
// !defined(AFX_ICPARAM_H__C61A7169_C356_48E6_8B8F_18201FE6EE23__INCLUDED_)
// ICParam.cpp: implementation of the CICParam class. //
//////////////////////////////////////////////////////////////////////
#include \#include \#include \#include \
#include \
#ifdef _DEBUG #undef THIS_FILE
static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW #endif
extern CFormater Formater; extern CLog Log;
////////////////////////////////////////////////////////////////////// // Construction/Destruction
//////////////////////////////////////////////////////////////////////
CICParam::CICParam() { }
CICParam::~CICParam() { DestoryCAPKList(); }
void CICParam::InitParam() { CString strPath = Formater.GetAppPath(); strPath += \ strPath.Replace(\ //MessageBox(NULL,strPath.GetBuffer(0),\目录\ CXmlDocumentWrapper XmlDoc; XmlDoc.Load(strPath);
//XmlDoc.Load(\ //CString strXMLInfo = XmlDoc.GetXML(); if (m_mapOfTlvEntity.GetCount() > 0) { //ICCInit接口系统进卡一次调用一次 ResetForNextCard(); } if (m_mapOfTlvEntity.GetCount() == 0) { InitSysParam(XmlDoc); InitTLVMap(XmlDoc); InitAIDList(XmlDoc); InitCAPKList(XmlDoc); } InitTerminalParms(XmlDoc); InitRelatedDataList(XmlDoc); }
void CICParam::ResetForNextCard() { ResetEntitybySource(IC_SOURCE_ICC); //DestoryTLVMap(); //DestoryAIDList(); ZeroMemory(&m_TerminalParams,sizeof(TERMINALPARAM)); //DestoryCAPKList(); DestoryRelatedDataList(); }
//读入标签数据元,生成TLVEntity的MAP
int CICParam::InitTLVMap(CXmlDocumentWrapper XmlDoc) { int iIndex,iTagNum; CString strTemp,strTempName,strTempVal; CXmlNodeWrapper node(XmlDoc.AsNode()); CXmlNodeListWrapper nodeList(node.FindNodes(\ int ncount = nodeList.Count(); if (ncount != 1) { MessageBox(NULL,\节点错误\ return ICC_ERR_XMLNODE; } CXmlNodeWrapper ParamNode = nodeList.Node(0); CString strName = ParamNode.Name(); iTagNum = ParamNode.NumNodes();
for (int i=0; i
pEntity->m_eFormat = IC_FORMAT_AN; else if (strTempVal.CompareNoCase(\ //Ans 字母数字及特殊字符型(Alphanumeric Special) pEntity->m_eFormat = IC_FORMAT_ANS; else if (strTempVal.CompareNoCase(\ //N 数字型(Numeric) pEntity->m_eFormat = IC_FORMAT_N; else if (strTempVal.CompareNoCase(\ //Var. 变长 pEntity->m_eFormat = IC_FORMAT_VAR; } if (strTempName.CompareNoCase(\ { if (strTempVal.CompareNoCase(\ pEntity->m_ucGetData = 1; } if (strTempName.CompareNoCase(\ { if (strTempVal.CompareNoCase(\ { pEntity->m_nTemplate1 = pEntity->m_nTemplate2 = 0; } else { iIndex = strTempVal.Find(\ if (iIndex == -1) { pEntity->m_nTemplate1 = (unsigned short)Formater.HexStrToInt(strTempVal); pEntity->m_nTemplate2=0; } else { strTemp = strTempVal.Left(iIndex); pEntity->m_nTemplate1 = (unsigned short)Formater.HexStrToInt(strTemp); strTemp = strTempVal.Mid(iIndex+1); pEntity->m_nTemplate2 = (unsigned short)Formater.HexStrToInt(strTemp); } } } if (strTempName.CompareNoCase(\ { iIndex = strTempVal.Find(\ if (iIndex == -1) { pEntity->m_nMinLen = pEntity->m_nMaxLen= atoi(strTempVal.GetBuffer(0));