Page 1 of 1

I got 0x6985 and 0x611C from my java card in different scenario.

Posted: Mon Jan 25, 2016 2:11 am
by nearsunshine
I have a written a java applet to send APDU command to my java card. When I am sending Init_Auth command(80500000...) to the card, it returns sw=0x6985.

But when I send the same command with pyApdutool, I get "611C".

It's odd. Could anyone give me a tip? Why does this happen?

Re: I got 0x6985 and 0x611C from my java card in different scenario.

Posted: Tue Jan 26, 2016 3:14 am
by horse dream
When it returns "61 1C" response, you need to send "Get response" APDU command.
>> 00 C0 00 00 1C

Re: I got 0x6985 and 0x611C from my java card in different scenario.

Posted: Tue Jan 26, 2016 3:20 am
by nearsunshine
horse dream wrote:When it returns "61 1C" response, you need to send "Get response" APDU command.
>> 00 C0 00 00 1C


Hi @ horse dream. Thank your for your answer. But I know this. My main question is why I got different status word("6985", "611C") when I send the same command via my java code and APDUTool.

Re: I got 0x6985 and 0x611C from my java card in different scenario.

Posted: Tue Jan 26, 2016 3:23 am
by mabel
You may try to append 0x1C to APDU command, just like:
80 50 00 00 0X AID 1C
note: 0x is the AID's length.

Re: I got 0x6985 and 0x611C from my java card in different scenario.

Posted: Tue Jan 26, 2016 3:25 am
by horse dream
nearsunshine wrote:Hi @ horse dream. Thank your for your answer. But I know this. My main question is why I got different status word("6985", "611C") when I send the same command via my java code and APDUTool.


For java, there is a "feature" in a package javax.smartcardio when it is working with a card protocol T=0
The solution of problem is to update that package with the errorless release.
You may have a try.

Re: I got 0x6985 and 0x611C from my java card in different scenario.

Posted: Wed Jan 27, 2016 5:32 am
by UNKNwYSHSA
The pyApdu tool select Security Domain (SD) first, and the INITIALIZE UPDATE command get response succeeded.
Make sure that your offcard application select SD first. If not, and if your card has one applet had RESET privilege. The INITIALIZE UPDATE command will be sent to the applet.