Java Reference
In-Depth Information
L ISTING 5.5 The CardTest Applet Class
package com.marinilli.b2.c5;
import javacard.framework.*;
/**
* Chapter 5 - An example Java Card Applet
* This applet writes back dummy byte sequences. It is meant to show the
* Java Card applet development process only.
*
* @author Mauro Marinilli
* @version 1.0
*/
public class CardTest extends Applet {
//standard APDU input offset values
public final static byte THIS_CLA = (byte)0x90;
public final static byte INITIALIZE_TRANSACTION = (byte)0x20;
public final static byte COMPLETE_TRANSACTION= (byte)0x22;
public final static byte INITIALIZE_UPDATE= (byte)0x24;
public final static byte COMPLETE_UPDATE= (byte)0x26;
// dummy byte sequences returned by this applet
private final static byte[] INIT_SEQUENCE = { (byte)0x1, (byte)0x2 };
private final static byte[] COMPLETE_SEQUENCE = { (byte)0x1, (byte)0x3 };
private final static byte[] INIT_UPDATE_SEQUENCE = { (byte)0x1, (byte)0x2,
(byte)0x3 };
private final static byte[] COMPLETE_UPDATE_SEQUENCE = { (byte)0x1,
(byte)0x1 };
/**
* Constructor.
* Only this class's install method can create the applet object.
*/
private CardTest() {
//perform some initialization here
// ...
register();//register this instance
}
/**
* Installs this applet.
* @param byteArray the array containing installation parameters
* @param offset the starting offset in byteArray
Search WWH ::




Custom Search