apdu

how to create APDU (TLV) parser in C

淺唱寂寞╮ 提交于 2019-11-30 16:21:41
问题 For example I have R-APDU like this uchar rApdu[] = {0x6F, 0x35 ,0x84 ,0x08 ,0x45 ,0x4F ,0x50 , 0x43 ,0x43 ,0x41 ,0x52 ,0x44 ,0xA5 ,0x29 ,0x50 ,0x06 ,0x55 ,0x5A ,0x4B ,0x41 ,0x52 ,0x54 ,0x5F, 0x2D, 0x06 ,0x75 ,0x7A ,0x72 ,0x75 ,0x65 ,0x6E ,0x87 ,0x01 ,0x01 ,0x9F ,0x11 ,0x01 ,0x01 ,0x9F, 0x12 ,0x06 ,0x55 ,0x5A ,0x4B ,0x41 ,0x52 ,0x54 ,0xBF ,0x0C ,0x05 ,0x9F ,0x4D ,0x02 ,0x0B ,0x0A}; I want to parse this TLV in C, like on this page: parsed TLV It should parse all tags and their value and take

Reading public data of EMV card

元气小坏坏 提交于 2019-11-30 16:04:42
问题 Say I want to read public elements of EMV card. I will list some steps which I think are involved. 1. First, select application In order to select application we must: (1) find out AID of application using PSE (if present) (2) Try existing AID list. Now, imagine I successfully selected application using one of the two methods above. My question is : What steps I must undertake further to read the public elements of EMV card? More precisely: Do I need to provide card with PDOL and get AIP and

NFC reader “SELECT (by AID)” APDU is not routed to Android device

时光毁灭记忆、已成空白 提交于 2019-11-30 15:38:22
I have an ACR122U NFC reader/writer connected to my Windows machine with ACR122 driver installed. I try to use javax.smartcardio API to send an SELECT (by AID) ADPU to my Android device (which should be in HCE mode). This is my code: TerminalFactory factory = TerminalFactory.getDefault(); List<CardTerminal> terminals = factory.terminals().list(); CardTerminal terminal = terminals.get(0); System.out.println(terminal.getName()); Card card = terminal.connect("*"); CardChannel channel = card.getBasicChannel(); execute(channel, new byte[] { (byte) 0xFF, 0x00, 0x51, (byte) 195, 0x00}, card); execute

How mature is the Android NFC ISODep support?

半腔热情 提交于 2019-11-30 13:25:56
问题 I understand that this is a "discussion" topic that has no definite answer, but I would really like some feedback on what to expect when developing NFC APPs for Android, in particular using IsoDep to communicate with DESFire cards using APDU frames. Can I expect that the same APDU frames sent to a particular DESFire card responds identically across Android Devices and versions? What Android versions and devices should I test on as a minimum to be reasonably well covered? Is it common with

How to send commands to smart card reader (and not to the smart card) while no card present?

此生再无相见时 提交于 2019-11-30 08:20:34
Preface: I have a dual interface smart card reader that has some extended capabilities (other than sending APDU commands to card and receiving APDU responses). For example in its document it is mentioned that you can get firmware version of your reader using following command: GET_FIRMWARE_VERSION: FF 69 44 42 05 68 92 00 05 00 In its tool, there is a button for this function and it works fine: I even sniffed USB port to see what exactly exchanged in the connection between my PC and my reader for this function: Command: Response: Problem: I want to get my reader version (and maybe send other

How mature is the Android NFC ISODep support?

不羁的心 提交于 2019-11-30 07:28:59
I understand that this is a "discussion" topic that has no definite answer, but I would really like some feedback on what to expect when developing NFC APPs for Android, in particular using IsoDep to communicate with DESFire cards using APDU frames. Can I expect that the same APDU frames sent to a particular DESFire card responds identically across Android Devices and versions? What Android versions and devices should I test on as a minimum to be reasonably well covered? Is it common with bugs or regressions in the Android drivers or can I expect that these are rooted out a long time ago? What

KitKat: How to route APDUs to the SIM

跟風遠走 提交于 2019-11-30 06:33:06
问题 I want to route APDUs I get from an NFC Reader to the SIM Card. According to the HCE documentation I thought it would be possible simply by creating an OffHostApduService with the according routing-entries (which I did). Sadly, the SIM does not seem to get any APDUs. SELECT-Commands that work when the SIM is directly attached to my workstation by a SIM-Reader return with 6a82 (File not found). In LogCat I found two interesting bits of information: Every time I shoot a select command which

How do I read the PAN from an EMV SmartCard from Java

六眼飞鱼酱① 提交于 2019-11-30 02:24:15
I need to read account number from Maestro/Mastercard with smart card reader. I am using Java 1.6 and its javax.smartcardio package. I need to send APDU command which will ask EMV application stored on card's chip for PAN number. Problem is, I cannot find regular byte array to construct APDU command which will return needed data anywhere... You shouldn't need to wrap the APDU further. The API layer should take care of that. It looks like the 0x6D00 response just means that the application did not support the INS. Just troubleshooting now, but you did start out by selecting the MasterCard

javax.smartcardio: how to send native commands to Desfire card?

二次信任 提交于 2019-11-29 23:30:58
问题 I am creating a java application communicating with a Mifare DESFire card through a PC/SC contactless reader and the javax.smartcardio API. I manage to send regular ISO 7816 APDUs (CLA, INS, P1-P2, Lc, Command data, Le). I have read on Ridrix's Blog that DESFire cards (at least the EV1 version that I am using) support both APDUs and Native commands where most of the commands are only 1 byte long. For example, the " Get Version " command: Command: 60 Response: af 04 01 01 00 02 18 05 I tested

NFC reader “SELECT (by AID)” APDU is not routed to Android device

。_饼干妹妹 提交于 2019-11-29 23:04:51
问题 I have an ACR122U NFC reader/writer connected to my Windows machine with ACR122 driver installed. I try to use javax.smartcardio API to send an SELECT (by AID) ADPU to my Android device (which should be in HCE mode). This is my code: TerminalFactory factory = TerminalFactory.getDefault(); List<CardTerminal> terminals = factory.terminals().list(); CardTerminal terminal = terminals.get(0); System.out.println(terminal.getName()); Card card = terminal.connect("*"); CardChannel channel = card