Process method does not receive full APDU command from host?

后端 未结 2 612
夕颜
夕颜 2021-01-14 14:53

The host sends the following command to applet to select EF file

00 A4 02 00 02 40 01

The purpose is to select EF file with ID 40 01<

相关标签:
2条回答
  • Depending on the card (or emulator), the APDU buffer may only contain the APDU header fields (CLA, INS, P1, P2, Lc). Even if some cards automatically fill the data part of the command APDU into the APDU buffer, you can't rely on that behavior.

    Instead, you have to explicitly instruct the card (or emulator) to retrieve the data part by calling the setIncomingAndReceive() method on the APDU object. But note that this method must only be called for case 3 and case 4 APDUs (i.e. APDU commands that contain a command data part). If there is no command data field, you should not call this method (case 1 and case 2 APDUs).

    0 讨论(0)
  • 2021-01-14 15:39

    To get data in APDU buffer you need to call apdu.setIncomingAndReceive() and as in EMV specification AID for an applet is 5-16 bytes can't use less than 5 bytes.

    0 讨论(0)
提交回复
热议问题