Question

Using the framework described here, I'm trying to read from a smart card. I have built an apdu command. The command structure appears to be correct because it works in java. When I call the SCardTransmit() function, the command gets executed, but it returns an empty response buffer of length Le+2 bytes. The first two bytes holding SW1 and SW2 are 6118. I believe this means that there are more bytes to be read into the buffer. However when I change the buffer size, the response buffer size is changed but i still get error code 6118. This is a select command that is followed by a get data command returning status 6100, which I think means that there are more than 0xFF bytes to be read still. So how do I get the response buffer to be filled?

Was it helpful?

Solution

The described behaviour matches a T=0 protocol card. In that protocol you never get the command response directly, but have to send a GET RESPONSE command with the length reported in the return code of the previous command, here 0x18.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top