Reputation: 737
I have a 1443 type B card and I can read ATR by send SELECT command with file id is 0x2F01 and then send READBINARY command
00 B0 00 00 00
This is response:
4301F84703F741E07F6608020205F0020205F09000
But why the command 00 B0 81 00 00
does not work?. According to ISO/IEC 7816-4 this command use to read EF with 5 bits of P1xP2 as file short ID (00001), and Le = 0x00 specify that need to read all bytes of file.
Do I miss something? How to read file with short ID?
About the returned ATR, it is defined in SC17_N5781_ISO_IEC_FDIS_7816-62_Identification. It shows that:
Tag 43 --> Card Service Data
Length 01 --> 1 byte
Value F8 --> See ISO/IEC 7816-4 12.1.1.5
Tag 47 --> Card Capabilities
Length 03 --> 3 bytes
Value F7 41 E0 --> See ISO/IEC 7816-4 12.1.1.9
Tag 7F66 --> Extended Length APDU
Length 08 --> 8 bytes
Value --> See ISO/IEC 7816-4 12.7.1
Tag 02
Length 02
Value 05 F0
Tag 02
Length 02
Value 05 F0
But I can not find 7816-4 section 12 which is mentioned above. Therefore, I can not clarify definition of values in the returned ATR although I can read ATR successful now. Is this standard published?
Upvotes: 1
Views: 2077
Reputation: 6298
In the meanwhile Android 9 is offering the SEService. After getting a reader with getUiccReader
on the Reader a session can be opened. The Session has a method getATR
.
Upvotes: 0
Reputation: 94048
If you have an ISO/IEC 14443 A type card then then the ATS will contain most of the information that is otherwise stored in the ATR. In that case it is unlikely that there will be an EF.ATR defined for the card - the availability of this file is not mandatory.
The presence of EF.ATR is more likely for ISO/IEC 14443 type B cards as the ATS will be missing.
If EF.ATR is present then it is possible to select it using SELECT by File ID (2F01). This file is likely to have short file identifier 0_0001 (5 bit binary) as you try with the READ BINARY command in the question, but it would be recommended to try with the full file ID to be sure. Then you simply read out the file using READ BINARY or GET DATA if reading the file cannot be performed.
Upvotes: 1