Java Card, strange as it may sound to those who think Java is a bloated environment, is an implementation of Java small enough to run on smart cards. Java Card has become very popular, and Java-enabled smart card produced by major players such as Schlumberger and Gemplus are readily available.

The Java Card environment is a very stripped-down version of a real Java environment. Its virtual machine supports only a limited subset of types (anything harder to implement than an int is out, and int is only available on higher-end models), multi-dimensional arrays are unavailable, there are limits on the length of methods, bytecode verification is done off-chip, garbage collection is usually unavailable, etc. Its runtime environment (JCRE - Java Card Runtime Environment) deals mostly with encryption and storage of small amounts of data and APDU (Application Protocol Data Unity, the standard for smart card communication) support.

Java Card source code is an interesting read. We usually see Java code that uses large data types to store small values and the such, based on the Java-esque idea that hardware is/should be fast enough for everything. Java Card programmers, on the other hand, do a lot of bit polishing like using static final everywhere they can, casting loop counters to shorts even if ints are available, using bitfields for compact data storage and using ASCII instead of Unicode.

Most recent SIM cards are Java Card-compatible. Java Card has been adopted as a GSM standard, and it's also possible to use it on other kinds of networks. The cell phone can be used to control applications running on the SIM card using a protocol called STK, short for SIM Toolkit. The GSM 10.48 standard defines a way to encode APDUs inside SMS messages, so that the operator can update applications (and control everything else) on the SIM card remotely and transparently.

More information is available at

Log in or register to write something here or to contact authors.