SmartCardIO EMV阅读器,找到我的卡类型只有ATR号码 [英] SmartCardIO EMV Reader, find my card type with only the ATR number

查看:361
本文介绍了SmartCardIO EMV阅读器,找到我的卡类型只有ATR号码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开始一个新项目,我是新用的EMV阅读器和Javax SmartCardIO。

I´m starting a new project, I´m new using EMV reader and Javax SmartCardIO.

我有每种类型卡的RID列表,但是我唯一可以在不知道卡类型的情况下访问的是ATR,我想知道是否有办法获得RID或只有这个信息的卡类型,欢迎任何帮助。

I have the list of the RID for each type of card, however the only thing I can access without knowing the type of card is the ATR, I´m wondering if there is a way to get the RID or the card type with only this info, any help is welcome.

提前致谢!

编辑:

我试图执行使用此方法选择PSE命令:

I tried to execute the select PSE command with this method:

public static byte[] selectPSE(CardChannel channel) throws CardException {
    byte[] selectPSE = {(byte)0x00, (byte)0xA4, (byte)0x04, (byte)0x00, (byte)0x0E, (byte)0x31, (byte)0x50, (byte)0x41, (byte)0x59, (byte)0x2E, (byte)0x53, (byte)0x59, (byte)0x53, (byte)0x2E, (byte)0x44, (byte)0x44, (byte)0x46, (byte)0x30, (byte)0x31};
    CommandAPDU command = new CommandAPDU(selectPSE);
    ResponseAPDU response = channel.transmit(command);
    System.out.println(response.getBytes());
    return response.getBytes();
}

然而,它只与AMEX和Visa合作,我得到了带有两张万事达卡(信用卡和借记卡)的错误6a82。

However, It is only working with an AMEX and Visa, I´m getting the error 6a82 with two MasterCard Cards(credit and debit).

这看起来很奇怪,据我所知,所有主要的发卡机构(包括万事达卡)都使用1PAY。 SYS.DDF01,我可以通过AID的Try和Error得到我想要的信息,但我不认为这是最好的解决方案。

This looks very strange, as far as I know all the major card issuers (including MasterCard) use 1PAY.SYS.DDF01, I can get the information I want with Try and Error of the AID but I don´t think this is the best solution.

推荐答案

AID(应用程序ID)= RID(已注册的应用程序ID)|| PIX(属性应用程序扩展)

AID (Application ID) = RID(Registered Application ID) || PIX (Property Application Extension)

如何识别卡上安装的应用程序的最佳方法 - 使选择PSE EMV第1册,12应用程序选择,12.3.2使用PSE 中的详细说明。

The best way how to recognize what application is installed on card - make Select PSE. Detailed description in EMV Book 1, 12 Application Selection, 12.3.2 Using the PSE.

您可以在图17中找到完整算法:使用目录的终端逻辑。

Full algorithm you can find on Figure 17: Terminal Logic Using Directories.

快速算法:

1)命令选择 PSE或PPSE。

1) Command Select PSE or PPSE.

  Send: 00 A4 04 00 0E 31 50 41 59 2E 53 59 53 2E 44 44 46 30 31 00

  Responce will will contain:
   '6F' FCI Template M
      '84' DF Name M
      'A5' FCI Proprietary Template M
        '88' SFI of the Directory Elementary File M
        '5F2D' Language Preference O
        '9F11' Issuer Code Table Index O
        'BF0C' FCI Issuer Discretionary Data O

在这里你可以找到PSE的 SFI

Here you can find SFI of PSE.

2)命令 ReadRecord 1 SFI X

2) Command ReadRecord 1 SFI X

 Send: 00 B2 01 0C 00

  Receive list of tag. 
   '70' Application Elementary File (AEF) Data Template                
      '61' Application Template                                           
        '70' Application Elementary File (AEF) Data Template                
          '61' Application Template                                           
            '4F' Application Identifier (AID)
            '50' Application Label
            ...  and so on

查看标记'4F'应用程序标识符(AID)。您可以从中提取并比较RID。

Look there for Tag '4F' Application Identifier (AID). From it you can extract and compare RID.

Аlso你可以:

1)获取自己的AID列表并从中连续选择SELECT应用程序。

1) Get own list of AID and successively SELECT application from it.

2)SELECT Default或Next应用程序并从响应中获取AID。

2) SELECT Default or Next applications and get AID from response.

这篇关于SmartCardIO EMV阅读器,找到我的卡类型只有ATR号码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆