10 years ago: Java Card 1.0 on JavaWorld

At the end of 1997 and at the beginning of 1998, and around the release of Java Card 2.0, JavaWorld ran a series of articles on Java Card. Most of these articles were written by Sun employees, and in particular Rinaldo di Giorgio, Zhiqun Chen, and Arthur Coleman. These articles are interesting, because they show Sun’s point of view from 10 years ago, which is great. I will therefore post a few comments on these articles.

Browsing through the articles, I found that one of them was in fact about writing program for the original Cyberflex, based on the Java Card 1.0 specification (BTW, I am still desperately looking for a PDF of that spec). As first things come first, I will start by commenting this piece of Java Card history.

The article is titled Get a jumpstart on Java Card, and it was written by Rinaldo di Giorgio. It describes the Cyberflex card, and provides a few hands-on examples of Java Card applications.

I can’t resist copying a small program here, so here is their second example, which will verify a CHV (PIN code):

public class Verifchv {

// Constants used throughout the program
static final byte ACK_CODE = (byte)0;
static final byte BUFFER_LENGTH = 32;
static final byte ISO_COMMAND_LENGTH = (byte)5;

public static void main () {

// Reset the RST bootstrap pointer to the ROM bootstrap
     _OS.Execute((short)0, (byte)0);
    byte bReturnStatus; 

      byte pbuffer[] = new byte[ISO_COMMAND_LENGTH];
      byte dbuffer[] = new byte[BUFFER_LENGTH];



 /////////////////////////////////////////////////////////
 //  Look for a message that contains the correct key
 /////////////////////////////////////////////////////////

 while (true) {
        // Command w/ right chv is 
        // pBuffer = C0 20 00 01 08
        // dBuffer = 48 49 4A 4B 4C 4D 4E 4F
            _OS.GetMessage(pbuffer,
                           ISO_COMMAND_LENGTH, ACK_CODE);

        bReturnStatus =
           _OS.VerifyCHV(pbuffer[3], dbuffer, (byte)0x00);
        _OS.SendStatus((byte)bReturnStatus);
        ///////////////////////////////////////////////
        // Give the user access and/or data based
        // on success or failure of the CHV
        ///////////////////////////////////////////////
        }
    }
}

Well, that’s quite different from what we know today. Let’s comment a few of the important pars of it.

public class Verifchv {

That’s from far the most significant part of the code. It reminds us that we are looking at a Java program, not a native program. The most important contribution of Cyberflex and Java Card 1.0 has been to show that the Java Virtual Machine could run on a smart card, even with very small memory. This was really innovative: remember that, at that time, Java mostly consisted of applets, running on workstations. Even Java ME did not exist (in fact, Java ME is an an indirect consequence of Java Card, but this is another story). Thinking that this big system could run on a card was a great idea.

public static void main () {

Java Card 1.0 is Java, but only for the virtual machine. Because of size and performance constraints, everything is basically static in this specification, so the source code ends up looking a lot like C code.

 while (true) {

At the heart of a Java Card 1.0 program, there is an infinite loop. This loop is still here, but it is now part of the JCRE. These first applications completely controlled the card, just like a native program would. An application would only release control to the system through a specific API.

bReturnStatus =
     _OS.VerifyCHV(pbuffer[3], dbuffer, (byte)0x00);

In Java Card 1.0, the operating system also kept the traditional structure of a smart card OS, based on ISO 7816, file systems, etc. We see here an example, with a function that performs a VERIFY CHV command.

The article also shows that the Cyberflex defined many features that were really innovative:

  • It introduces the notion of conversion of class files to an optimized format, through a post-processor.
  • It introduces the notion of multiple entities represented on a card to manage applications.

At the end of the day, this article reminds us that Java Card 1.0 has been a very significant contribution to the history of smart card, and Schlumberger’s Austin team should get full credit for that. It also reminds us that innovation is a stepwise process, that it takes a long time to build a new system and to get past the existing technology, and that Java Card 2.0 also was an important step ahead.

2 Comments

  • lexdabear wrote:

    Yeah, it’s quite interesting to see how it started out. Helps to understand why we are where we are today. Do you why Schlumberger decided for a Java based solution? Was there a market demand or just a ‘cool idea and see how the market takes it’?

  • I only entered the smart card business in 1997, so I can’t say what happened in 1996. The only thing I know is that the initial work was done in research labs, so there is little chance that this was in response to a market demand.

    However, there was a market demand for SIM Toolkit applications at that time, and all major manufacturers were fighting with their own proprietary scripting technology. So, in some way, there was a demand, but definitely nothing that said Java, which at that time, was mostly known for browser applets.

Leave a Reply

Your email is never shared.Required fields are marked *