简体   繁体   English

读EMV卡的序列号

[英]Reading EMV card's serial number

I am trying to read an EMV card. 我正在尝试阅读EMV卡。 As specified for EMV cards, a tag called "9F1E", holds a permanent serial number specified by the issuer (see https://www.eftlab.co.uk/index.php/site-map/knowledge-base/145-emv-nfc-tags ). 根据EMV卡的规定,名为“9F1E”的标签包含发行人指定的永久序列号(请参阅https://www.eftlab.co.uk/index.php/site-map/knowledge-base/145- emv-nfc-tags )。

However, I could not retrieve this tag. 但是,我无法检索此标记。 I looped through all the records of all SFIs. 我浏览了所有SFI的所有记录。 Is there any way to ask for a specific EMV tag? 有没有办法要求特定的EMV标签?

The value 91FE is not a valid BER-TLV tag, so you probably meant 9F1E (which is the only tag in that list with a description that contains the text "serial number"). 91FE不是有效的BER-TLV标记,因此您可能意味着 9F1E (该列表中唯一带有包含文本“序列号”的描述的标记)。 (OP corrected this. This indeed meant to be 9F1E .) (OP纠正了这个。这确实意味着9F1E 。)

The tag 9F1E is described as "Interface Device (IFD) Serial Number, Unique and permanent serial number assigned to the IFD by the manufacturer". 标签9F1E被描述为“接口设备(IFD)序列号,由制造商分配给IFD的唯一且永久的序列号”。 Hence, this is a tag used within the terminal (ie the smartcard reader side, also called the "interface device"). 因此,这是终端内使用的标签(即智能卡读卡器侧,也称为“接口设备”)。 This tag is not present within any card. 任何卡中都不存在此标记。 Consequently, you cannot retrieve it from a card. 因此,您无法从卡中检索它。

When you are looking for a value contained within a specific data object, the proper way would be to read all records from the card until you find the data object tag. 当您查找特定数据对象中包含的值时,正确的方法是从卡中读取所有记录,直到找到数据对象标记。 Some cards also support the GET DATA command to query for specific tags in certain situations. 某些卡还支持GET DATA命令以在某些情况下查询特定标签。 That GET DATA command would look like this: 那GET DATA命令看起来像这样:

80 CA P1 P2 00

Where P1 contains the first byte of the tag (or 00 if the tag consists of only one byte) and P2 contains the second byte of the tag (or the only byte if the tag consists of only one byte). P1包含标记的第一个字节(如果标记只包含一个字节,则为00 ),P2包含标记的第二个字节(如果标记只包含一个字节,则为唯一的字节)。

In order to identify ( do not mix this with authenticate! ) the card holder or the card itself, EMV provides other ways: 为了识别( 不要与身份验证混合! )持卡人或卡本身,EMV提供其他方式:

There is the primary account number (PAN) and the PAN sequence number. 有主帐号(PAN)和PAN序列号。 The PAN usually identifies the card holder's payment account. PAN通常会识别持卡人的付款帐户。 If the card holder gets a new replacement card from the bank (eg because the old card expires), the PAN usually stays the same for the new card (exceptions may exist). 如果持卡人从银行获得新的替换卡(例如因为旧卡过期),则新卡的PAN通常保持不变(可能存在例外情况)。 Similarly, the PAN sequence number stays the same for a card and all follow-up cards (ie those issued due to exipry of the older card). 类似地,对于卡和所有后续卡(即由于旧卡的出现而发布的卡),PAN序列号保持相同。 Consequently, the combination of PAN and PAN sequence number could, at best, be used to identify the card holder. 因此,PAN和PAN序列号的组合最多可用于识别卡夹。

The closest thing to a card serial number (ie something that identifies one specific card) that you can get from a card is the ICC (Integrated Circuit Card) public key (see tags 9F46 , 9F47 , and 9F48 ). 最接近的事到卡序列号(即东西标识一个特定的卡),您可以从卡得到的是ICC(集成电路卡)公钥(见标签9F469F479F48 )。 This is the public part of the asymmetric key pair of the smartcard. 这是智能卡的非对称密钥对的公共部分。 While, in theory, an issuer could reuse even this key pair for multiple cards, I would assume that card issuers issue a fresh key pair for every new card for security reasons. 虽然理论上发行人甚至可以重复使用这个密钥对用于多张卡,但我会假设发卡机构出于安全原因为每张新卡发出一对新密钥对。

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

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