Search code examples
smartcardapdu

what is difference between "acr38 card tools" & "opensc"?


I have uploaded a HelloWorld.cap file in a Javacard and sent some APDU commands via "acr38 card tool" software to the card and received Helloworld! in ASCII code as output. But when I sent same APDU commands with opensc-tool I received Invalid arguments in output instead of HelloWorld! What is the problem?

ACR38 card tool output:

< 00 A4 04 00 0B 00
< 01 02 03 04 05 06 07 08 09 00 66
> 610B

< 00 C0 00 00 00 0B
> 62 79 62 79 65 20 57 6F 72 6C 64
> 9000

Opensc-tool output:

C:\Program Files\OpenSC Project\OpenSC\tools>opensc-tool.exe -s 00:a4:04:00:0b:0
1:02:03:04:05:06:07:08:09:00:66
Using reader with a card: ACS CCID USB Reader 0
Sending: 00 A4 04 00 0B 01 02 03 04 05 06 07 08 09 00 66
Received (SW1=0x90, SW2=0x00)

C:\Program Files\OpenSC Project\OpenSC\tools>opensc-tool.exe -s 00:c0:00:00:00:0
b
Using reader with a card: ACS CCID USB Reader 0
Sending: 00 C0 00 00 00 0B
APDU transmit failed: Invalid arguments

Solution

  • I assume, that opensc-tool implicitly resets the card on start. So the effect of the first command, i. e. selection of the application, is lost when sending the second command. I would try next, to specify the two commands in the same opensc-tool call.