In ISO 7816 the ISO "case" of each command should be known in advance. In other words, the commands have either:
- no command data & no response data
- no command data, but response data
- command data but no response data
- command data and response data
In general, commands do not send response data if a status word indicating an error occurs, even if the ISO case states that response data is expected.
Now in table 14 it is stated for SW1 SW2 9000
:
Process completed normally. In cases 1, 2 and 3, no further action. In case 4, after receiving command data bytes, the card shall be ready to receive at least one GET RESPONSE command for transferring at most Ne response data bytes.
So only for ISO case 4, where you send command data and expect response data, you should send a GET RESPONSE
after 9000
. If however you are using an ISO case 2 and you receive a 9000 then you should not send a GET RESPONSE
.
It seems to me that as long as you specify an Ne value for one of the ISO case 4 CommandAPDU
(i.e. one that includes command data as well) that javax.smartcardio
should issue a GET RESPONSE
APDU upon receving a 9000
SW1/SW2. This means that either the documentation is incomplete or that the implementation is incorrect.