Documentation



Java Card 3 Platform Development Kit User Guide, Classic Edition

Overview of Using the Reference Implementation

The Reference Implementation (RI) is a simulator that can be built with a ROM mask, much like a Java Card technology-based implementation for actual field use. It has the ability to simulate persistent memory (EEPROM) and to save and restore the contents of EEPROM to and from disk files. Applets can be installed in the RI, and it performs I/O through a socket interface, simulating the interaction with a card reader (CAD). It implements the T=1, T=CL, or T=0 protocols for communications with the CAD.

The Java Card RI supports the following:

  • Up to 20 logical channels per communication interface

  • Integer data type

  • Object deletion

  • Card reset in case of object allocation during an aborted transaction

In this version of the development kit, the RI is available as a 32-bit implementation that supports the ability to go beyond the 64KB memory access. The RI supports the T=1 and T=CL in dual concurrent interface mode. This development kit also supports T=0 and T=1, both in single interface mode. Table 10-1 lists the Java Card RE executables by protocol.


Table 10-1 Protocols Supported by RE Executables

RE Executable Supported Protocol

cref_t0.exe

T=0 protocol (single port), as defined in ISO 7816.

cref_t1.exe

T=1 protocol (single port), as defined in ISO 7816.

cref_tdual.exe

T=1 and T=CL (each on separate port). Uses T=1 for the contact protocol, and the T=CL for the contactless version, as defined in ISO 14473. This is the default executable for cref.bat.


Note:

The descriptions, command-line syntax, and options in this chapter for running cref_tdual.exe also apply to cref_t0.exe and cref_t1.exe. The difference is solely in the supported protocols.

The binary versions of the REs available in this development kit are provided in the JC_CLASSIC_HOME\bin directory as the executables cref_t0.exe, cref_t1.exe, and cref_tdual.exe. Each binary corresponds to the supported protocols described in Table 10-1. The development kit also includes the cref.bat file whose default is to run the RI with T=1/T=CL, but it can also run the RI using the other supported protocols according to arguments shown in Table 10-2.


Table 10-2 Case Sensitive Command Line Options for cref.bat

Option Description

[-t0 | -t1 | -tdual]

Specifies the RE version to run according to the desired protocol (see Table 10-1). Defaults to -tdual to call cref_tdual.exe if not specified.

-b

Dumps a bytecode histogram at the end of the execution.

-e

Displays the program counter and stack when an exception occurs.

-h, -help

Prints a help screen.

-i input-file-name

Specifies a file to initialize EEPROM. There can be no spaces in the file name argument.

-n

Performs a trace display of the native methods that are invoked.

-nobanner

Suppresses the printing of a program banner.

-nomeminfo

Suppresses the printing of memory statistics when execution starts.

-o output-filename

Saves the EEPROM contents to the named file.

-e2pfile file-name

Specifies the EEPROM file. If the file exists it is read to initialize the EEPROM image. All e2pfile images are written to this file. This option is the same as combining -i and -o into one.

-p port-number

Connects to a TCP/IP port using the specified port-number.

-contactedport port-number

Connects to a TCP/IP port using the specified port-number.

-s

Suppresses output. Does not create any output unless followed by other flag options.

-t

Performs a line-by-line trace display of the mask's execution.

-version

Prints only the program's version number. Do not execute.

-z

Prints the resource consumption statistics.


Close Window

Table of Contents

Java Card: 3 Platform Development Kit User Guide, Classic Edition

Expand | Collapse