Reputation: 309
I am usually writing Java Card Software with JCOP, but nowadays I am trying out other development structures to get a little more insight. So I am using a simple HelloWorld.java as I have started with this one on JCOP as well - http://umer555.wordpress.com/2012/05/17/java-card-hello-world-applet/
Now I tried to run this on NetBeans with Java Card 3.0 (Classic, so I guess it should work the just like 2.2.2) and it works like a charm out of the Box.
Next step for me is trying it with Eclipse and JCDE. Now, by creating the cap file I get this as the first three lines (which respond 9000 in APDUTool):
powerup;
// Select the installer applet
0x00 0xA4 0x04 0x00 0x09 0xa0 0x00 0x00 0x00 0x62 0x03 0x01 0x08 0x01 0x7F;
0x80 0xB0 0x00 0x00 0x00 0x7F;
As the next step I try to create my "HelloWorld" applet with AID 010203040501
// create HelloWorld applet
0x80 0xB8 0x00 0x00 0x8 0x6 0x01 0x02 0x03 0x04 0x05 0x01 0x00 0x7F;
this returns
0x80 0xb8 0x00 0x00 0x08 0x06 0x01 0x02 0x03 0x04 0x05 0x01 0x00 0x7f;
CLA: 80, INS: b8, P1: 00, P2: 00, Lc: 08, 06, 01, 02, 03, 04, 05, 01, 00, Le: 00
, SW1: 64, SW2: 44
and JCWDE reports an "Exception from the invoked install() method: ..."
So from the response I figure that somehow the applet is not loaded into the simulator, but I don't know why this is the case!
Upvotes: 4
Views: 925
Reputation: 29993
There is no "installer applet" in the card. There is a card manager applet, that does all cad system operations.
Card manager AID known to me are:
const
VISA_CARDMANAGER_AID = 'A0000000030000';
MASTERCARD_CARDMANAGER_AID = 'A0000000040000';
GEMPLUS_CARDMANAGER_AID = 'A000000018434D00';
Is your card really JCOP one?
To start installing an applet you need to issue Install/Load command first (CLA=80/84, INS = E6). In your case you start from 80/84 and B8 on some reason.
After Install/Load you need to issue LOAD commands to upload cap file to the card.
Please refer to the GlobalPlatform documentation to know more about APDU commands (search Google for the document named "GPCardSpec_v2.2.pdf" or download it from here: http://www.globalplatform.org/specificationscard.asp
Upvotes: 0