问题描述
我正在C平台上工作,我想阅读卡的AFL.如果选择上一个命令,选择AID,不要给我PDOL标记,没关系:我可以毫无问题地阅读AFL.但是我需要编写一种方法,无论PDOL为何,都可以生成GET PROCESSING OPTION.
I'm working on a C platform and I want to read the AFL of a card.If the previous command, select of the AID, don't give me a PDOL tag, it's ok: I can read the AFL without issues.But I need to write a method that can generate a GET PROCESSING OPTION regardless the PDOL.
所以问题是:
- 尽管编写了PDOL,我如何编写一种通用的方法?
我是否要映射每个可能的TAG? - 如何格式化GPO命令输入正确的数据?看下面的例子:
- How can I write an universal method that work despite the PDOL?
Have I to map every single possible TAG? - How can I format the GPOcommand with the correct data? Look the following example:
SELECT AID响应PDOL:9F 1A 02
所以我必须输入终端国家代码,在我的情况下是意大利:380因此,GPO调用为:
SELECT AID ResponsePDOL: 9F 1A 02
So I have to put the Terminal Country Code, in my case Italy: 380So the GPO call is:
80 A0 00 00 04 83 02 03 80 00
但是我得到的答复是6D 00
:指令代码不受支持或无效
But the response that I have is 6D 00
: Instruction code not supported or invalid
我在哪里错了?
我正在Ingenico Pos(销售点)上编程.
I'm programming on Ingenico Pos (Point of sale).
推荐答案
很高兴知道您对PDOL的概念非常了解.就您的问题,据我所知,如果不存在PDOL,您很乐意构造GPO命令.我认为您有疑问要编写一个通用函数来构造GPO APDU命令.
Good to know that you are aware with the concept of PDOL very well. As far I can understand with your question, you are comfortable to construct GPO command if PDOL is not present. I think You are in doubt to write a generic function to construct GPO APDU command.
首先,我想告诉您,如果SELECT响应中存在PDOL信息,那么您应该在GPO命令APDU中发送PDOL数据,否则卡应用程序可能会抛出一些错误.
First of all I want to tell you that if PDOL information is present in SELECT response then you should send PDOL data in GPO command APDU, otherwise card application may throw some error.
因此,当您在SELECT命令中收到PDOL时,可以设置一个指示器.如果PDOL不存在,您可以简单地发送80 A8 00 00 02 83 00 00,如果您的指示符指示需要PDOL,则只要您知道就可以解析PDOL并从SELECT响应中为PDOL数据准备一个值(如您所描述的).您的问题)将在GPO命令APDU中发送.
So you can set an indicator when you receive PDOL in SELECT command. If PDOL is not there you can simply send 80 A8 00 00 02 83 00 00 and if your indicator stated that PDOL is required then simply parse the PDOL and from SELECT response and prepare a value for PDOL data if you know (as you described in your question) to be send in GPO command APDU.
如果您不知道什么值,则只需在值字段中填充十六进制零即可.
If you don't know what value then you can simply fill hexadecimal zeros in value field.
以您的示例为例:80 A8 00 00 04 83 02 03 8000.这是正确的命令(我已经更正了INS字节).或者,您也可以发送80 A8 00 00 04 83 02 00 00 00(PDOL值替换为零)
Taking your example : 80 A8 00 00 04 83 02 03 80 00. This is the correct command (I have corrected INS byte). Or you can also send 80 A8 00 00 04 83 02 00 00 00 (PDOL value is replace by zeros)
我认为这种解释可以帮助您获得两个问题的答案.尝试一下,让我们知道是否需要进一步澄清.
I think this explanation can help you to get the answers of both the questions. Try it and let us know if there is any further clarification needed.
这篇关于EMV-具有PDOL的GPO的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!