如何从IsoDep得到更多的卡数据?

如何从IsoDep得到更多的卡数据?

问题描述:

我真的在与NFC编程新手。
我想访问例如在卡上的NFC-标签帐号。
我已经发现该卡(PayPass卡,维萨卡ASO)是一家IsoDep-技术。

I am really a newbie at programming with NFC. I want to access e.g. the Account number on the NFC- Tag on the card. I already found out that the card (PayPass, Visa aso.) is a IsoDep- Tech.

我的code迄今:

Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
IsoDep isoDep = IsoDep.get(tag);
isoDep.connect();
byte[] result = isoDep.transceive(??????????????????);

我知道,如果你想在卡上存取数据你在transeceive方法使用APDU。我不知道我有什么类型。

I know that if you want to access Data on the card you have to use APDU in the transeceive Method. I am not sure what i have to type.

我有什么写访问卡上的数据?

What do I have to write to access the data on the card?

请看看这个开源项目:

https://github.com/devnied/EMV-NFC-Paycard-Enrollment

用来读取和提取NFC EMV信用卡数据的Java库

A Java library used to read and extract data from NFC EMV credit cards

我用它法语信用卡和它工作得很好。

I use it for french credit cards and it works well.

UPDATE1

创建所有APDU和由库管理。你只需要实现接口IProvider:
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/master/library/src/main/java/com/github/devnied/emvnfccard/parser/IProvider.java

All APDUs are created and managed by the library. You just have to implement interface IProvider: https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/master/library/src/main/java/com/github/devnied/emvnfccard/parser/IProvider.java

下面IProvider的实现:
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/master/sample/src/main/java/com/github/devnied/emvnfccard/provider/Provider.java

Here a implementation of IProvider: https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/master/sample/src/main/java/com/github/devnied/emvnfccard/provider/Provider.java

IsoDep发送到Provider类,并且在收发方法,APDU发送:

IsoDep is sent to Provider class, and in method transceive, APDU are sent:

    /**
     * Tag comm
     */
    private IsoDep mTagCom;

    @Override
    public byte[] transceive(final byte[] pCommand) throws CommunicationException {
        [...]
        byte[] response = null;
        [...]
        // send command to emv card
        response = mTagCom.transceive(pCommand);
        [...]

        return response;
    }