Excited to tell you that our welfare activity has been upgraded - Paying only $5.00 + Freight to get JCOP J3H145 card and A40CR card.
Please check this post for more details.

Moreover, if you want to get Free Samples by Paying Freight only , please check this page.

how to solve this question?

JavaCard Applet Development Related Questions and Answers.
happy123654
Posts: 28
Joined: Wed Jun 20, 2018 4:06 am
Points :154
Contact:

how to solve this question?

Post by happy123654 » Thu Oct 25, 2018 10:25 pm

hello, every boy, who can help me to resolve this question?

Now, I use my tool to test my java cos. there is a test case failure in T0 protocol and success in T1 or TCL.
the command is as followed:
send: 80050000
the right response: 256 bytes data +SW.
the real response: The tool cannot receive anything.

If I modify the commad as followed:
send:80500000
the right response: 255 bytes data +SW
the real response: ==the right response

later123654
Posts: 11
Joined: Tue May 22, 2018 9:43 pm
Points :126
Contact:

Re: how to solve this question?

Post by later123654 » Thu Oct 25, 2018 10:38 pm

hello, you can provide your code here which can help me to parse this question.

happy123654
Posts: 28
Joined: Wed Jun 20, 2018 4:06 am
Points :154
Contact:

Re: how to solve this question?

Post by happy123654 » Thu Oct 25, 2018 10:52 pm

public void process(APDU apdu)
{
if (selectingApplet())
{
return;
}

byte[] buf = apdu.getBuffer();
switch (buf[ISO7816.OFFSET_INS])
{
case (byte)0x01:
Util.arrayFillNonAtomic(buf, (short)0, (short)256, (byte)0xaa);
apdu.setOutgoingAndSend((short)0, (short)256);
break;
case (byte)0x02:
Util.arrayFillNonAtomic(buf, (short)0, (short)256, (byte)0xbb);
apdu.setOutgoingAndSend((short)0, (short)255);
break;
default:
ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
}
}

later123654
Posts: 11
Joined: Tue May 22, 2018 9:43 pm
Points :126
Contact:

Re: how to solve this question?

Post by later123654 » Thu Oct 25, 2018 10:55 pm

I test the code and the command with JCOP card and the question is still exist.
But the command is ok:
the command( 8005000000) can return 256 bytest data.

so you can modify the command.

happy123654
Posts: 28
Joined: Wed Jun 20, 2018 4:06 am
Points :154
Contact:

Re: how to solve this question?

Post by happy123654 » Thu Oct 25, 2018 10:57 pm

hello boy. I modify my command to be 8005000000 and I can get the right response.

but why?

later123654
Posts: 11
Joined: Tue May 22, 2018 9:43 pm
Points :126
Contact:

Re: how to solve this question?

Post by later123654 » Thu Oct 25, 2018 11:32 pm

I guess the reason : the reader handle the command as case 1 and refuse the response data from the card.

happy123654
Posts: 28
Joined: Wed Jun 20, 2018 4:06 am
Points :154
Contact:

Re: how to solve this question?

Post by happy123654 » Thu Oct 25, 2018 11:33 pm

i see and thanks very much!

BirdKing
Posts: 40
Joined: Wed Nov 04, 2015 7:23 am
Points :286
Contact:

Re: how to solve this question?

Post by BirdKing » Wed Oct 31, 2018 2:46 am

T0 is an imperfect protocol. It claims the applet and host on pc knows how many bytes will be translated. You may add setIncomingAndReceive() and try this apdu again.

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 2 guests

JavaCard OS : Disclaimer