1

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.

My code so far:

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

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?

Artjom B.
  • 61,146
  • 24
  • 125
  • 222
romaneso
  • 1,097
  • 1
  • 10
  • 26

1 Answers1

1

Please have a look at this open-source project:

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

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

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

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 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;
    }
LaurentY
  • 7,495
  • 3
  • 37
  • 55
  • Thanks for the reply! i already took a look, but i dont get the transcieve method... could someone explain it to me? – romaneso Apr 10 '15 at 19:30
  • yeah it is, but i wanted to know the behind information. So, for example, what i have to send to the card (which bytes... what format... how to parse and so on...) – romaneso Apr 29 '15 at 11:26
  • @romaneso, it depends on type of card, applet deployed on card. You have to get specification for each case, for instance if you want to read EMV card, specification are https://www.emvco.com/specifications.aspx There's no standard way to read data on all type of cards. – LaurentY Apr 29 '15 at 12:19
  • Can you explain to me how to read f.e. an Austrian "Bankomatkarte"? (paypass - Logo) Which bytes do i have to send? – romaneso Apr 30 '15 at 07:16
  • Did you try with an EMV library ? I can't develop and make test for you. – LaurentY Apr 30 '15 at 07:37
  • i would just like to know what bytes i have to send on the card to get a response... that is really hard to find in the internet – romaneso Apr 30 '15 at 10:07