A Java Card applet is a class written in the Java Card subset of the Java language that inherits the javacard.framework.Applet class. This class is a blueprint that defines some variables and methods of an applet. It makes, for instance, the implementation of the install and process methods obligatory. The install method creates the applet by invoking its constructor method and registers it in the Java Card Runtime Environment (JCRE), by invoking the register method. The process method receives the APDU messages of the host application, does the initial processing of these messages, and invokes a method, passing to it the APDU object as a parameter.
The Java programming language itself has a number of advantages over other application programming languages in the area of security. And the Java Card platform provides further security enhancements, such as the applet firewall. (In Java Card terminology, an application is known as an applet.) Standard Java platform development practices allow for the secure distribution of compiled Java classes with Jar files and cryptographic signatures. And analogously, CAP files (converted applet files) and cryptographic signatures are part of installation procedures to load Java Card applets into the smart card.
Applet Firewall
The Java Card platform provides a secure execution environment with an applet firewall between different applets in the same card. A Java Card applet resides in the card isolated from other applets by the firewall. The firewall is a feature of the Java Card runtime environment to provide detailed control over the use of data stored in objects that have a shared implementation. The firewall mechanism transparently gives an applet a private partition of the card memory. As a result, a malfunctioning or even hostile applet cannot affect the functioning of the card or any another applet loaded on the card.