|
Java Card basics |
| For the purpose of this article, the term Java Card denotes a Java Card technology-enabled smart card. Java Card technology allows applets written in the Java language to be
executed on a smart card. It defines a Java Card Runtime Environment (JCRE) and provides classes and methods to help developers create applets. Applets run within the JCRE. The JCRE and APIs are modeled after the smart card specification
ISO 7816.
When a Java Card is inserted into a card acceptance device (CAD), the CAD selects an applet on the card and sends it a series of commands to execute. Each applet is identified and selected by its application identifier (AID). Commands such as the selection command are formatted and transmitted in the form of application protocol data units (APDUs). Applets reply to each APDU command with a status word (SW) that indicates the result of the operation. An applet can optionally reply to an APDU command with other data. |
As with any software application development, before sitting down and writing a Java Card applet, you should first go through a design phase. In this phase, you define the architecture of the applet.
Four steps comprise the applet-design phase:
In the following sections, we'll use the example of a wallet applet to take a detailed look at each of the steps in the applet-design process.
Our example wallet applet will store electronic money and support credit, debit, and check-balance functions.
To help prevent unauthorized use of the card, it contains a security algorithm. This algorithm requires the user to enter a PIN, a string of eight digits at most. The card user types his or her PIN on a keypad connected to the CAD. The security algorithm causes the card to lock after three unsuccessful attempts to enter the PIN. The PIN is initialized according to the installation parameters when the applet is installed and created.
Balance of the wallet IIBy Anonymous on January 27, 2010, 5:42 amIf it is planned to use more than 32767 as a maximum balance than there must be done some improvements to the arithmetics. INT 32 bit is not widely supported so...
Reply | Read entire comment
Balance of the walletBy Anonymous on January 27, 2010, 5:34 amcan be maximally 32767 if keeper of the balance is short. If we use fragmented values, we can add some byte value to represent fragmented value. IE. (short) 32767,...
Reply | Read entire comment
Not understoodBy Anonymous on January 7, 2010, 1:15 am"For simplicity, let's say the card's maximum balance is 2,767, and that no credit or debit transaction can exceed 27!!" How it is? Please Elaborate.
Reply | Read entire comment
gud manBy Anonymous on December 30, 2009, 6:53 amgud man
Reply | Read entire comment
commentsBy Anonymous on August 25, 2009, 5:19 amvery very good
Reply | Read entire comment
View all comments