This discussion is archived
5 Replies Latest reply: Nov 19, 2012 11:54 AM by safarmer RSS

manually upload .cap file on a java card

948184 Newbie
Currently Being Moderated
Hi

I wonder how to manually upload a .cap file on a java card. I do know that it must be an or more APDUs that contain the file and so on.
What I wonder is how to convert a .cap file into a byte array (byte array that on-card installer can read and understand) without using JCOP or any other tools? Does (must) this array have a special format or something?

I am interested in the process of taking a.cap file and convert it to byte array (nothing else).

Thanks in advance!

/Lyudmila
  • 1. Re: manually upload .cap file on a java card
    Sebastien_Lorquet Journeyer
    Currently Being Moderated
    hello, to convert the cap file into load block file format see the javacard spec

    to upload a load block to a javacard see the globalplatform spec. you need some TDES crypto.
  • 2. Re: manually upload .cap file on a java card
    safarmer Expert
    Currently Being Moderated
    Specifically it is in the JCVM Spec under Section 6: The CAP file format. There is a part on installation as well. The data in each LOAD command is also defined in the GlobalPlatform Card Spec.

    - Shane

    Edited by: safarmer on Aug 30, 2012 1:15 PM
  • 3. Re: manually upload .cap file on a java card
    959194 Newbie
    Currently Being Moderated
    HI, you can download the GPShell from source forge, that 's OK
  • 4. Re: manually upload .cap file on a java card
    940605 Newbie
    Currently Being Moderated
    The .cap file uploading mechanism depends if you have a java card or a GlobalPlatform card.
    If you have a java card you can use the same mechanism that it is used with Cref (see Java Card Kit - Development Kit - Chapter 11): .cap file is divided in n apdus, one or more (if a component not fit in one apdu, for example method component) for component (first:Header.cap, second:directory.cap, third:import.cap, etc).
    If you use a GlobalPlatform card, the mechanism is more complex:
    first you have to create a session using a specific protocol (SCP01, SCP02, etc) through INITIALIZE UPDATE and EXTERNAL AUTHENTICATE commands, then an INSTALL FOR LOAD command and n LOAD commads as they are necessary.
    To use GlobalPlatform mechanism, see GlobalPlatform Specification 2.1.1.
  • 5. Re: manually upload .cap file on a java card
    safarmer Expert
    Currently Being Moderated
    The .cap file uploading mechanism depends if you have a java card or a GlobalPlatform card.
    Java Card cards are GlobalPlatform based.
    If you have a java card you can use the same mechanism that it is used with Cref (see Java Card Kit - Development Kit - Chapter 11): .cap file is divided in n apdus, one or more (if a component not fit in one apdu, for example method component) for component (first:Header.cap, second:directory.cap, third:import.cap, etc).
    If you use a GlobalPlatform card, the mechanism is more complex:
    first you have to create a session using a specific protocol (SCP01, SCP02, etc) through INITIALIZE UPDATE and EXTERNAL AUTHENTICATE commands, then an INSTALL FOR LOAD command and n LOAD commads as they are necessary.
    To use GlobalPlatform mechanism, see GlobalPlatform Specification 2.1.1.
    The JCRE spec does not define the applet loader and CREF has a basic version of an applet loader that is not GP compliant, but this is not the Java Card standard. To load onto any physical Java Card you will need to follow the GlobalPlatform specification.

    - Shane

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points