简体   繁体   English

EMV Pidion BIP 1300

[英]EMV Pidion BIP 1300

I'm currently working with PIDION BIP-1300, does anyone have examples of how to retrieve values of a smart card chip? 我目前正在使用PIDION BIP-1300,有没有人有如何检索智能卡芯片价值的例子?

I'm using C# and BB_EMV.dll... I can't find any documentation... 我正在使用C#和BB_EMV.dll ...我找不到任何文档...

This is sort of what I'm using: 这是我正在使用的一种:

EMV emv = new EMV();
byte[] DE_5A;
DE_5A = emv.GetData("DE_5A");

All I receive is a byte array full of zeroes. 我收到的只是一个充满零的字节数组。

Thanks in advance! 提前致谢!

ok I don't know what BB_EMV is and have never heard of it, but reading EMV data from a smart card is not easy, I'll tell you that now. 好的,我不知道BB_EMV是什么,也从未听说过,但是从智能卡读取EMV数据并不容易,我现在就告诉您。

First things, you need a good managed library that will let you do APDU level access on the card in question, I use this one : http://www.smartcard-api.com/index.shtml 首先,您需要一个好的托管库,该库可以让您在有问题的卡上进行APDU级别的访问,我使用以下库: http : //www.smartcard-api.com/index.shtml

Once you have that, add a reference to it just as you would any other managed library, there's samples with the kit so I'm not going to go into details using it, it's not to difficult to get your own code running. 一旦有了它,就可以像添加其他任何托管库一样添加对它的引用,该工具包中包含示例,因此我不打算使用它来详细介绍它,让您自己的代码运行不难。

I have code, but it's copyright to the client I've written it for so I can't give you it. 我有代码,但它是我写的客户版权所以我不能给你它。

Once your in a position to start sending commands to the card, and if it's a card that supports a standard EMV structure, the first thing you'll want to do is select the PSE, there are typically 2 ways of doing this. 一旦您开始向卡发送命令,并且它是支持标准EMV结构的卡,您要做的第一件事就是选择PSE,通常有两种方法可以做到这一点。

1) Use AID selection 1)使用AID选择

From a list of AID (Application ID's) that you are prepared to accept send the following command to the card: 从您准备接受的AID(应用程序ID)列表中,将以下命令发送到卡:

0x00, 0xA4, 0x04, 0x00 0x00,0xA4,0x04,0x00

Follow this by the AID you wish to select, for VISA Debit this is typically 按照您希望选择的AID进行此操作,对于VISA借记通常是这样

0xA0, 0x00, 0x00, 0x00, 0x03, 0x10, 0x10 0xA0,0x00,0x00,0x00,0x03,0x10,0x10

This follows the APDU data above as a data block followed by 0x07 (The data Length) 这跟随上面的APDU数据作为数据块后跟0x07(数据长度)

What you should get back is either 你应该得到什么也是

0x9000 or 0x6100 (If you get a 61 code it means you have to redo the request with modified parameters, beyond the scope of what I'm writing here) 0x9000或0x6100(如果您得到61代码,则意味着您必须使用修改后的参数重做请求,这超出了我在此处编写的范围)

if you get a 0x9000 in SW1 & SW2 (Card registers) then you have successfully selected that AID and are ready to make EMV calls to it. 如果在SW1和SW2(卡寄存器)中得到0x9000,则说明您已经成功选择了该AID,并准备对其进行EMV调用。

2) Use the DDF Name to select the required payment application, essentially you use the standard card select commands to select "1PAY.SYS.DDF01" if it's a contact chip & pin or "2PAY.SYS.DDF02" if it contactless this is known as selecting using the PPSE. 2)使用DDF名称选择所需的支付应用程序,基本上你使用标准卡选择命令选择“1PAY.SYS.DDF01”如果它是接触芯片和引脚或“2PAY.SYS.DDF02”如果它是非接触式的,这是称为使用PPSE进行选择。

Once you have a payment app selected, you then need to read the processing opts from the card, this will tell you some info about what's available and where to look. 选择付款应用程序后,您需要阅读卡中的处理选项,这将告诉您一些可用信息以及查找位置的信息。

This is done by issuing a read GPO command that looks like the following: 这是通过发出如下所示的read GPO命令来完成的:

0x80, 0xA8, 0x00, 0x00, 0x83, 0x00 0x80、0xA8、0x00、0x00、0x83、0x00

This will return a TLV structure which you'll have to parse for the details. 这将返回TLV结构,您必须对其进行解析以获取详细信息。

TLV is a very simple concept, your data stream is divided into 3 groups a TLV是一个非常简单的概念,您的数据流分为3组a

TAG 标签

LENGTH 长度

and

VALUE

hence TLV, 因此TLV,

TLV Tags can be variable length between 1 and 3 bytes long, typically though you never see greater than 2 bytes. TLV标记可以是1到3个字节长的可变长度,通常虽然您看不到大于2个字节。 If your first byte anded with 0x1F is greater than 31, (that is bits 6 or 7 are set) then you have a 16 bit tag, in which case you need to take the byte you just received shift it left by 8 bits, then add the next byte in the sequence. 如果你的第一个字节与0x1F一起大于31(即设置了第6位或第7位),那么你有一个16位标签,在这种情况下你需要把你刚收到的字节移位8位,然后在序列中添加下一个字节。

Like wise with the next byte if anding it by 128 gives you 128 then you have a 2 byte length between 1 and 15 bits, once you have the TAG and Length the next length remaining bytes are the payload. 就像明智的做法一样,如果将下一个字节除以128,则得到128,那么您的2个字节的长度在1到15位之间,一旦有了TAG和Length,则剩下的下一个字节就是有效负载。

That payload can be nested, in fact you will most likely find TLV structures within TLV structures so a good recursive parser will need to be written. 该有效负载可以嵌套,实际上您很可能会在TLV结构中找到TLV结构,因此需要编写一个好的递归解析器。

After you've parsed the data from the GPO object, you can then use this to find the actual card data, this is where you start to read things like the PAN and track2 equivalent data please note however that while there are standards in place not all of them are 100% identical. 在您从GPO对象解析数据之后,您可以使用它来查找实际的卡数据,这是您开始阅读PAN和track2等效数据之类的内容请注意,尽管有标准但没有它们都是100%相同的。 Most cards have a custom data area, also note that PIN & CVV numbers are NOT available directly from the card, instead what you will find is that in most cases there will be an encrypted PIN or CVV block, this is designed to be sent to the issuing back along with the appropriate certificate from the card , the issuer will then report if the pin entered was correct. 大多数卡都有一个自定义数据区,同时请注意,PIN和CVV号码不能直接从卡中获取,而是您会发现在大多数情况下会有加密的PIN或CVV块,这是为了发送到如果回卡连同证卡中的相应证书,发行人将报告输入的订单是否正确。

Some cards can do offline PIN verification however, wolfgang rankels site is full of great information of some of the various standard functions and data calls that are available, mostly on GSM Sim cards but he does cover EMV too you can find his site here : 有些卡可以进行离线PIN验证,但是,沃尔夫冈等级网站上充满了一些可用的各种标准功能和数据通话的重要信息,主要是在GSM SIM卡上,但他确实覆盖了EMV,你可以在这里找到他的网站:

http://www.wrankl.de/ http://www.wrankl.de/

There's a HUGE amount more to this subject than I've described here, this is just the tip of the iceberg, however since you posted this over 6 months ago I'm guessing you've possibly made some headway on your own by now, if not then I hope this helps. 这个主题比我在这里描述的要多得多,这只是冰山一角,但是自从你在6个月前发布这个以来,我猜你现在可能已经取得了一些进展,如果没有,那么我希望这有帮助。

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

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