I'm confused about Get Response command. I thought I know it but actually I don't.
I wanna know the mechanism in which the card returns 1000-bytes data in case 4. I guess the command is as follows. Please let me know the correct one if it is wrong.
(Card) <== [CLA] [INS] [P1] [P2] [Lc] [Data] [Le] // response data size is 1000 bytes
(Card) ==> 6100
(Card) <== 00 C0 00 00 00
(Card) ==> [Data(256)] 6100
(Card) <== 00 C0 00 00 00
(Card) ==> [Data(256)] 6100
(Card) <== 00 C0 00 00 00
(Card) ==> [Data(256)] 61E8
(Card) <== 00 C0 00 00 E8
(Card) ==> [Data(232)] 9000 (61E8 was my mistake)
Questions
I hope any response or URL of the related information.
To answer your questions:
Finally, the card should of course return 9000
or a status word indicating a warning or error instead of 61E8
for the last command (this was subsequently fixed in the question as mistake in the question).
Note that you should not blindly assume that the response will contain the amount of bytes requested. An Le byte with value 00
for instance indicates a maximum response size of 256 bytes.
This is all defined in ISO/IEC 7816-4, chapter 5.3.4: Response chaining
The current version is 2013(E) at the time of writing. It's payware (but Google isn't).