如何读取基于EMV的智能VISA卡详细信息

发布于 2024-11-17 17:41:20 字数 347 浏览 5 评论 0原文

我正在尝试从 VISA 卡读取信用卡数据,但无法成功。正如在互联网资源中我发现对于 MASTER 卡,我们可以使用 1PAY.SYS.DDF01 文件选择 PSE 目录,然后阅读记录。但对于 VISA 来说,它不是强制性的,当我使用 SELECT 命令使用以下文件来获取 PSE 目录时,我得到的响应为“6A82”。这意味着文件系统不支持它。我在 EMV 4.2 Book 1(EMV 规范)中查找了错误,它说我们必须使用“AID 列表”。它说“终端使用其列表中的下一个 AID 发出另一个 SELECT 命令”。 我无法理解这一点并进一步进行。

有关如何获取 VISA 卡的 PSE 或 AID 以获取信用卡详细信息的任何帮助吗?

谢谢, 谢卡尔

I am trying to read the credit card data from the VISA card but could not able to make a success.As in the internet resources I have found that for the MASTER card we can select the PSE directory using 1PAY.SYS.DDF01 file and then read the records. But for VISA its not mandatory and when I use the following file using SELECT command for getting the PSE directory I get the response as '6A82'.Which means its is not supported by the file system. I looked for the Error in the EMV 4.2 Book 1(EMV specification) and it says that we have to use a "List of AIDs". It says "The terminal issues another SELECT command using the next AID in its list".
I am unable to understand this and proceed further.

Any help on how to get the PSE for the VISA card or the AID to get the credit card details?

Thanks,
Shekhar

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

可遇━不可求 2024-11-24 17:41:20

首先,PPSE 小程序并不是专门针对 VISA 或 MasterCard 的。它由 EMV 定义,正如您所注意到的那样,它用于列出卡上可用支付应用程序的 AID。但如果不存在,终端会尝试所有支持的 AID 来构建候选列表。

如果您想选择 VISA 小程序,但您不知道完整的 AID,则可以使用部分选择。由于所有 VISA AID 均以 VISA 的 RID 开头:A0 00 00 00 03。您可以尝试发送此命令:

这将返回第一个实例:

00 A4 04 00 05 A0 00 00 00 03 00

,如果您的卡上有:

00 A4 04 02 05 A0 00 00 00 03 00

First of all PPSE applet is nothing specific for VISA nor for MasterCard. It is defined by EMV, and it is used as you correctly noticed for listing the AIDs of the available payment applications on the card. But if it is not there the terminals try all the supported AIDs to build the candidate list.

If you want to select the VISA applet, but you do not know the complete AID you can use partial selection. Since all the VISA AIDs begin with the VISA's RID: A0 00 00 00 03. You can try to send this command:

This will return the first instance:

00 A4 04 00 05 A0 00 00 00 03 00

and this will give you more if you have on your card:

00 A4 04 02 05 A0 00 00 00 03 00

余生再见 2024-11-24 17:41:20

那么问题是您不知道卡上应用程序的 AID 吗?没有任何方法可以获取它们(除了 PSE),您必须首先知道您支持卡上的哪些应用程序。因此,“AID 列表”是您支持的 AID 列表,这是您的收单机构告诉您的。您可以尝试根据此处列出的一些标准 AID 自行创建此列表:http:// en.wikipedia.org/wiki/EMV#Application_selection

So the problem is you don't know AID of your application on the card? There's no method to get them (except PSE), you have to know first what applications on card you support. So the "List of AIDs" is list of AIDs you support, which was told you by your acquirer. You can try to create this list yourself basing on some standard AIDs which you have listed here: http://en.wikipedia.org/wiki/EMV#Application_selection

鼻尖触碰 2024-11-24 17:41:20

这对我来说有点奇怪...我的研究表明,对于 VISA,该应用程序将始终可用,但对于 Mastercard,它不是强制性的...

无论如何,这是我发送到读卡器以选择该应用程序的命令:

//               OP CL P1 P2 LN DATA------------------------------------- EL
//select command 00 A4 04 00 0E 31 50 41 59 2E 53 59 53 2E 44 44 46 30 31 00

NSString* str= @"1PAY.SYS.DDF01";
NSData* data=[str dataUsingEncoding:NSUTF8StringEncoding];
int datalength = data.length; 
NSMutableData *selectPSECommand = [[NSMutableData alloc] init];

[selectPSECommand appendBytes:"\x00" length:1]; //command class
[selectPSECommand appendBytes:"\xA4" length:1]; //APDU_INSTRUCTION_SELECT_FILE
[selectPSECommand appendBytes:"\x04" length:1]; //select file by name
[selectPSECommand appendBytes:"\x00" length:1]; //First or only occurrence of file
[selectPSECommand appendBytes:&datalength length:1]; //data length
[selectPSECommand appendData:data]; //the data we are sending
[selectPSECommand appendBytes:"\x00" length:1]; //expected response length. here it is 0. We are only selecting a file.

该代码示例适用于 Objective C。

将您发送的数据与我发送的数据进行比较,看看是否对应。与此同时,我将研究如何运行 AID 列表。

希望有帮助。
埃兹弗拉格

It is kind of weird for me... My research indicates that for VISA that application will always be available, but for Mastercard it is not mandatory...

Anyway, Here is the command I send to my cardreader inorder to select that application:

//               OP CL P1 P2 LN DATA------------------------------------- EL
//select command 00 A4 04 00 0E 31 50 41 59 2E 53 59 53 2E 44 44 46 30 31 00

NSString* str= @"1PAY.SYS.DDF01";
NSData* data=[str dataUsingEncoding:NSUTF8StringEncoding];
int datalength = data.length; 
NSMutableData *selectPSECommand = [[NSMutableData alloc] init];

[selectPSECommand appendBytes:"\x00" length:1]; //command class
[selectPSECommand appendBytes:"\xA4" length:1]; //APDU_INSTRUCTION_SELECT_FILE
[selectPSECommand appendBytes:"\x04" length:1]; //select file by name
[selectPSECommand appendBytes:"\x00" length:1]; //First or only occurrence of file
[selectPSECommand appendBytes:&datalength length:1]; //data length
[selectPSECommand appendData:data]; //the data we are sending
[selectPSECommand appendBytes:"\x00" length:1]; //expected response length. here it is 0. We are only selecting a file.

The code sample is for Objective C.

Compare the data you send with the data I'm sending and see if it corresponds. In the meantime, I'll be looking into running through the AID list.

Hope it helps.
Ezfrag

一向肩并 2024-11-24 17:41:20

您可以使用 AID 列表,例如

类似于:

  1. 读取卡迭代 AID 列表
  2. 如果返回 0x90(成功读取),则提取数据
  3. 检查返回的数据的类型为 AID (0x4f)。
  4. 出现这种情况时,请清除列表并使用正确的 AID 再次获取数据,因为您知道数据肯定是正确的,因为它直接来自卡。

由于 AID 通常出现在卡的第一条记录中,因此此循环可确保过程以最小的时间成本正确进行。

You can use an AID List like this one. However some cards respond with "wrong" data when iterating through the list. i.e., I had the case where a V-Pay VISA card was read as Maestro. If you have to iterate through a big AID List to "open" the card info, I would recommend you to add a flag to get the actual AIDs from the card, then go back to the main method to read the card with the main AID provided.

Something like:

  1. Read Card iterating through a AID List
  2. If 0x90 is returned (successful read), extract data
  3. Check where the data returned is of type AID (0x4f).
  4. When so, clear your list and get the data again with the proper AID now that you know it is right for sure as it comes directly from the card.

As the AID usually comes in the first records from the card, this loop ensures the process is correct at a minimum time cost.

盗心人 2024-11-24 17:41:20

当您使用此 1PAY.SYS.DDF01 第一个命令时,卡将首先响应 2 个 AID 列表,其中存在一些错误,因此您给出此 6A82 错误并返回代码 RETRY。您必须使用 ENRTY Libs,其中有一些删除命令,然后再次设置应用程序选择命令,这样它将自动获得第二个 AID,然后您的 Visa 卡就会成功。

When You are using this 1PAY.SYS.DDF01 first command the card will responce with 2 AID list inside first there is some error so that you give this 6A82 Error with return code RETRY.You have to use a ENRTY Libs inside there is some delete command and than set app select command again so it will automatically get second AID and than your visa card get success.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文