PBOC代码回顾(1)(6)

2020-05-05 13:54

#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 *pList,BYTE *ucDataBuf,USHORT *usDataLen); void ResetForNextCard(); int ResetRelatedData(BYTE ucResetType); int SetUnpredictableNumber(); BOOL TerminalSupportsCVM(BYTE ucCVMCode); BOOL VerifyCVMCondition(BYTE ucCVMCode,BYTE ucCVMCondition,ULONG ulMoneyX,ULONG ulMoneyY); int GetCVMEntry(BYTE *ucCVMEntry,int *pCVMNum); void SelectRandomTrans(__int64 nCurAmt); void CheckFloorLimit(__int64 nAmount); BOOL GetTransAmount(__int64 *pAmount); int VerifyExpiredDate(); int VerifyEffectiveDate(); int VerifyAppUsageControl(); int VerifyAppVersionNumber(); int DFNameMatchAID(BYTE *pDFName, USHORT usDFLen, BYTE *pAIDItem, USHORT usAIDLen); void InitParam(); CICParam(); virtual ~CICParam(); CList *pSADList; CPtrList m_listOfCAPK; TERMINALPARAM m_TerminalParams; int m_SysType; private:

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; im_nTag = (unsigned short)Formater.HexStrToInt(strTempVal); } if (strTempName.CompareNoCase(\ { pEntity->m_strName = strTempVal; } if (strTempName.CompareNoCase(\ { if (strTempVal.CompareNoCase(\ pEntity->m_ucSource = IC_SOURCE_ICC; else if (strTempVal.CompareNoCase(\ pEntity->m_ucSource = IC_SOURCE_TERMINAL; else if (strTempVal.CompareNoCase(\ pEntity->m_ucSource = IC_SOURCE_ISSUER; } if (strTempName.CompareNoCase(\ { if (strTempVal.CompareNoCase(\ //B 二进制(Binary) pEntity->m_eFormat = IC_FORMAT_B; else if (strTempVal.CompareNoCase(\ //An 字母数字型(Alphanumeric)

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));


PBOC代码回顾(1)(6).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:《圆明园的毁灭》图片

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: