Questions On CAP uploading

Hi, I want to upload applets to the card.

My card is GemcombiXpresso R4, compliant with GP2.1.2 and JC specification.

I found there are two ways:

1.Use Java card dev_kit provided by Sun

In this kits,apdutool is provided to upload applets.

In Dos,we type "apdutool *.src" to upload applets.

2.Load CAP files according to the card reference

There are several steps to be passed first: InitialUpdate->External Autheticate->Install [for load], then load my CAP file.

All of them are APDU commands.

But neither of them works.

For the 1st way, after I type apdutool command, it told me port connected but unknown driver or command (0x1). What does it mean?

For the 2ed way, I got the response :69 85.

I also have some questions to ask on CAP loading.

As I knew, CAP file consists of several components, such as : header, method , class , director and so on.

I found in *.src file that apdutool just upload those components to the card one by another. So is the purpose of CAP file loading only to upload those components to the card?

If yes, the other data I found in the CAP file doesn't need being uploaded. So when I use the Load APDU provided in card reference to load CAP file , I must not send other data except those components.

Is that I sent the whole CAP file consisting of components and other data caused the failure response : 69 85?

Thanks!

[1465 byte] By [Bobby_SHa] at [2007-11-27 3:52:24]
# 1

You state you have a GP2.1.1 card there (there is no GP2.1.2). So the content management is defined by this specification. Sun's Java Card Kit does not know anything about content management. The spec. merely states that there should be an Installer and an Applet Deletion Manager. GlobalPlatform Card Specification is filling this gap.

So you might now understand why -1- does not work (the error you describe is probably due to the fact if works with the provided simulator only).

In the second case we have a SW is returned which indicates that either the opening of the secure channel or the upload mechanism failed. To give you a better answer we would need to see the APDU trace and maybe the source code of the applet.

The Java Card 2.2.1 Virtual Machine Specification describes the CAP file format. You got it right, the components are just sent one after another. There are mandatory and optional (debug, applet and custom) components. The CAP file is just like a JAR file, but not executable, so you can unzip it and find only the specified components. I am wondering what other data you found in the CAP file.

lexdabeara at 2007-7-12 8:56:27 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 2

Your reply does great help to me.

Now I solved the problem.

You said a CAP file is a zipped file, so I unzipped HelloWorld.cap. I found two folder : COM and META-INF . In "COM" folder, there are Header.cap , Method.cap , Class.cap and so on. Those caps are the exact the CAP files I should send to the card, but not HelloWorld.cap.

Thanks very much! :)

Bobby_SHa at 2007-7-12 8:56:27 > top of Java-index,Java Mobility Forums,Consumer and Commerce...