Christmas is coming!

To celebrate the new year and thank for the support from all our dear customers, Christmas promotional activity is being held in JavaCardOS online store.

During the event, you can enjoy many promotional activities - High Discount on JavaCardOS products,Lucky Draw,Double forum Points.

Come to choose your own Christmas gift and try your luck now!

javacard ndef applet

Collect and collate various open source JavaCard applets.
All applets are under the open source licenses.

Moderator: Ellisun

shimizus3106
Posts: 11
Joined: Thu Oct 06, 2016 10:05 pm
Points: 104
Contact:

javacard ndef applet

Postby shimizus3106 » Thu Oct 06, 2016 10:19 pm

Hello.

Please let me ask about an applet of NDEF on JavaCard.

I'm trying
https://github.com/promovicz/javacard-ndef

Simulation works well on Netbeans,
but on Real smard card, it doesnt work well.

Here is error status with GP tool.

---------------------------------------------------
I installed with refering to

java -jar gp.jar \
-params 100BD101075402656E54657374 \
-install javacard-ndef.cap

But, it doesnt work well.
APDU Command with GP tool below:
Success : 9000
A>> T=0 (4+0007) 00A40400 07 D2760000850101
A<< (0000+2) (41ms) 9000

But, next is not success
A>> T=0 (4+0002) 00A4000C 02 E103
A<< (0000+2) (26ms) 6A86
------------------------------------------------------

and simulation result is below

------------------------------------------------------
An instance //aid/D276000085/0101 is created for //aid/D276000085/01.
run-client:
run-script:
Invoking apdutool on C:\Users\shigenori shimizu\Downloads\prj\Netbeans\java-ndef.mod/scripts/java_ndef.scr
ApduTool [v3.0.2]
Copyright (c) 2009 Sun Microsystems, Inc.
All rights reserved.
Use is subject to license terms.
Opening connection to localhost on port 9025.
Connected.
Received ATR = 0x3b 0xf0 0x11 0x00 0xff 0x00
CLA: 00, INS: a4, P1: 04, P2: 00, Lc: 07, d2, 76, 00, 00, 85, 01, 01, Le: 00, SW1: 90, SW2: 00
CLA: 00, INS: a4, P1: 00, P2: 0c, Lc: 02, e1, 03, Le: 00, SW1: 90, SW2: 00
CLA: 00, INS: b0, P1: 00, P2: 00, Lc: 02, 00, 0f, Le: 0f, 00, 0f, 20, 00, 80, 00, 80, 04, 06, e1, 04, 00, 0d, 00, ff, SW1: 90, SW2: 00
CLA: 00, INS: a4, P1: 00, P2: 0c, Lc: 02, e1, 04, Le: 00, SW1: 90, SW2: 00
CLA: 00, INS: b0, P1: 00, P2: 00, Lc: 01, 02, Le: 0d, 00, 0b, d1, 01, 07, 54, 02, 65, 6e, 54, 65, 73, 74, SW1: 90, SW2: 00
CLA: 00, INS: b0, P1: 00, P2: 00, Lc: 02, 01, 12, Le: 0d, 00, 0b, d1, 01, 07, 54, 02, 65, 6e, 54, 65, 73, 74, SW1: 90, SW2: 00
----------------------------------------------------------

From Debugging on real smart card,
it cannot pick up fileId from APDU command.

I dont know why it isnot same between simulator and real smart card.

Could you let me know how to run correctlly ?

Regards,
Shige

User avatar
mabel
Posts: 218
Joined: Mon May 18, 2015 3:09 am
Points: 1485
Contact:

Re: javacard ndef applet

Postby mabel » Sat Oct 08, 2016 1:38 am

6A 86 means incorrect parameters. What's your real card model? I can't see where can return the response 6A86 from the source code.

It should be returned by JCVM.

shimizus3106
Posts: 11
Joined: Thu Oct 06, 2016 10:05 pm
Points: 104
Contact:

Re: javacard ndef applet

Postby shimizus3106 » Mon Oct 10, 2016 12:40 am

Hello.

Thanks to your reply.

6A86 = 27270,
We can find - ISO7816.java

>> public static final short SW_INCORRECT_P1P2 = 27270;

and I often get other error pattern - 6A83 = 27266

>> public static final short SW_FILE_NOT_FOUND = 27266;


I dont know why the former error occur.

But, the latter case,

I guess that the error occur here

----------------------------------------
switch(fileId) {
case FILEID_NDEF_CAPABILITIES:
case FILEID_NDEF_DATA:
selectedFile = fileId;
break;
default:
ISOException.throwIt(ISO7816.SW_FILE_NOT_FOUND);
}
-----------------------------------------

But I dont know why the error occur there...

Regards,
Shige

User avatar
mabel
Posts: 218
Joined: Mon May 18, 2015 3:09 am
Points: 1485
Contact:

Re: javacard ndef applet

Postby mabel » Mon Oct 10, 2016 5:36 am

I have done a test on J3D081 card with ndef applet. It can run without any problem.

So I guess, there is something wrong with your card.

shimizus3106
Posts: 11
Joined: Thu Oct 06, 2016 10:05 pm
Points: 104
Contact:

Re: javacard ndef applet

Postby shimizus3106 » Fri Oct 14, 2016 2:17 am

Hello.

Please let me confirm addtional question.

Are there any relation to the version of Java Card OS ?
or Card resource - memory - ?

Regards,
Shige

User avatar
mabel
Posts: 218
Joined: Mon May 18, 2015 3:09 am
Points: 1485
Contact:

Re: javacard ndef applet

Postby mabel » Fri Oct 14, 2016 5:08 am

shimizus3106 wrote:Hello.

Please let me confirm addtional question.

Are there any relation to the version of Java Card OS ?
or Card resource - memory - ?

Regards,
Shige


Yes, I guess these is something wrong with your card OS.
Tell me your card model/type, maybe I can do some test for you.

shimizus3106
Posts: 11
Joined: Thu Oct 06, 2016 10:05 pm
Points: 104
Contact:

Re: javacard ndef applet

Postby shimizus3106 » Fri Oct 14, 2016 5:45 am

Hello.

Thanks to your quick reply.

My card is very dedicated and I don't know detail..
But OS seems that Java Card OS is ver 3.x..

Anyway to know requried information ? ex) with GP tool ?
If possible, I will tell information that I can disclose.

Regards,
Shige

User avatar
mabel
Posts: 218
Joined: Mon May 18, 2015 3:09 am
Points: 1485
Contact:

Re: javacard ndef applet

Postby mabel » Sat Oct 15, 2016 5:30 am

Two ways to know the card details.

W1. Get ATR of your card and show it here.

W2. Get CPLC
> Select CardManager
> Send command
00 CA 9F 7F 00

shimizus3106
Posts: 11
Joined: Thu Oct 06, 2016 10:05 pm
Points: 104
Contact:

Re: javacard ndef applet

Postby shimizus3106 » Mon Oct 17, 2016 6:29 am

Hello.

I tried and Here is my answer about 1. ATR

1. ATR

3B6800000073C84000009000


Reagrds,
Shige

User avatar
mabel
Posts: 218
Joined: Mon May 18, 2015 3:09 am
Points: 1485
Contact:

Re: javacard ndef applet

Postby mabel » Mon Oct 17, 2016 10:37 pm

shimizus3106 wrote:Hello.

I tried and Here is my answer about 1. ATR

1. ATR

3B6800000073C84000009000


Reagrds,
Shige


I can't see any card related information from the ATR.

Do you have other kinds of java cards, that can be used to test and verify this problem?


Return to “Open Source Applets”

Who is online

Users browsing this forum: No registered users and 1 guest

JavaCard OS : Disclaimer