简体   繁体   English

SmartCardIO EMV阅读器,找到我的卡类型,只有ATR号码

[英]SmartCardIO EMV Reader, find my card type with only the ATR number

I´m starting a new project, I´m new using EMV reader and Javax SmartCardIO. 我正在开始一个新项目,我是新用的EMV阅读器和Javax SmartCardIO。

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

Thanks in advance! 提前致谢!

EDIT: 编辑:

I tried to execute the select PSE command with this method: 我尝试使用此方法执行select PSE命令:

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

However, It is only working with an AMEX and Visa, I´m getting the error 6a82 with two MasterCard Cards(credit and debit). 但是,它只与AMEX和Visa合作,我得到了两张万事达卡(信用卡和借记卡)的错误6a82。

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. 这看起来很奇怪,据我所知,所有主要的发卡机构(包括万事达卡)都使用1PAY.SYS.DDF01,我可以通过试用和错误的AID得到我想要的信息,但我不认为这是最好的解。

AID (Application ID) = RID(Registered Application ID) || AID(应用程序ID)= RID(已注册的应用程序ID)|| PIX (Property Application Extension) PIX(物业申请延期)

The best way how to recognize what application is installed on card - make Select PSE . 如何识别卡上安装的应用程序的最佳方法 - 选择PSE Detailed description in EMV Book 1, 12 Application Selection, 12.3.2 Using the PSE . EMV第1册,12应用选择,12.3.2使用PSE的详细说明。

Full algorithm you can find on Figure 17: Terminal Logic Using Directories. 您可以在图17中找到完整算法:使用目录的终端逻辑。

Quick algorithm: 快速算法:

1) Command Select PSE or PPSE. 1)命令选择 PSE或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

Here you can find SFI of PSE. 在这里你可以找到PSE的SFI

2) Command ReadRecord 1 SFI X 2)命令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

Look there for Tag '4F' Application Identifier (AID). 查看Tag'4F'应用程序标识符(AID)。 From it you can extract and compare RID. 从中您可以提取并比较RID。

Аlso you can: Аlso你可以:

1) Get own list of AID and successively SELECT application from it. 1)获取自己的AID列表并从中连续选择SELECT应用程序。

2) SELECT Default or Next applications and get AID from response. 2)SELECT Default或Next应用程序并从响应中获取AID。

There is no way to get RID values from card with ATR. 无法通过ATR从卡中获取RID值。 ATR is used to identify card hardware and software, it is not used to get info about installed applications(visa, visa electron, mastercard etc) https://eftlab.com/index.php/site-map/knowledge-base/212-emv-rid ATR用于识别卡硬件和软件,它不用于获取有关已安装应用程序的信息(签证,签证电子,万事达卡等) https://eftlab.com/index.php/site-map/knowledge-base/212 -emv-RID

There is one way to get installed applications , reading Payment System Environment(PSE ) of card . 有一种方法可以安装应用程序,阅读卡的支付系统环境(PSE)。 You can send Read PSE commands to contact cards and Read Proximity PSE command for contactless cards 您可以将Read PSE命令发送到联系人卡片,并为非接触式卡片发送Read Proximity PSE命令

Contact PSE: 联系PSE:

00A404000E315041592E5359532E4444463031 00A404000E315041592E5359532E4444463031

Contactless PPSE: 非接触式PPSE:

00A404000E325041592E5359532E444446303100 00A404000E325041592E5359532E444446303100

And then you must parse if there is more than one installed application. 然后,如果安装了多个应用程序,则必须解析。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM