Managing Applets and Sending APDU Commands
To manage the Java Card applets and send APDU commands use Java Card View and Java Card Development Kit Simulator Console.
-
Start the Simulator by right-clicking on
Java_Card_Simulator_1in Java Card View and selecting Start. -
The console opens with the output from the Simulator and displays a prompt: CMD>. You can enter an APDU command at this prompt that is sent to the card (
Java_Card_Simulator_1), and the response is shown in the console. -
One simple way to test if the console is running is to type the
helpcommand at the prompt:help;You should see the available commands that can be used from the terminal.
- To load and install a built package there are two options:
- In the terminal, run the two following commands sequentially,
in the order
shown:
load CAP_FILE_AID CAP_FILE_PATH; install CAP_FILE_AID AID;Note:
(A semicolon, ";", must be placed at the end of each command). - From the user interface, click on the drop down menu from the
Java_Card_Simulator_1console. The available commands for all imported projects will be displayed. Before sending any command, you must connect first by pressing Connect. The list displays all projects from the current workspace with the Simulator set for Java_Card_Simulator_1. Inside each project submenu, you'll find all CAP files associated with that project. Each CAP file displays a lists of all available commands specific to that file. Click on Load CAP_AID/Package_AID and wait for the command to execute, then click on Install CAP_AID/Package_AID Applet_AID (package.AppletName).
- In the terminal, run the two following commands sequentially,
in the order
shown:
All available commands:
- Connect – Performs a card connection to the Simulator.
- Disconnect - Performs a card disconnection from the Simulator.
If the Simulator is launched from the Plug-in, you can reconnect pressing the
Connect or typing
Connect;in the console. - List applets – Displays AID for installed applets on card.
For each CAP file from each Java Card Project submenu, you will have following commands:
- Load CAP_AID/Package_AID – Loads the applet on the card.
- Unload CAP_AID/Package_AID – Unloads the
Applet_Namefrom card. - Load, Install, Select CAP_AID/Package_AID Applet_AID – Loads,
installs and selects the
Applet_Namefrom card in one command. - Custom Install CAP_AID/Package_AID Applet_AID
(package.AppletName) – Install the loaded applet on the card with
Application Specific Parameters and/or with different Applet Instance AID. (After
this command is executed with different Applet Instance AID, a new
SelectandUninstallcommand will be generated for new Applet Instance AID). - Install CAP_AID/Package_AID Applet_AID (package.AppletName) – Install the loaded applet on the card.
- Select CAP_AID/Package_AID Applet_AID (package.AppletName) –
Select the
Applet_Name. - Uninstall CAP_AID/Package_AID Applet_AID (package.AppletName) –
Uninstalls the
Applet_Namefrom card.
Run Configuration
Run Configuration can be used to automate how commands are run. You can specify whether the Simulator shall be connected or re-connected and provide a list of commands to be executed.
Java_Card_Simulator_1) for the current project (Port number
and GP ISD AND SCP03 Keys Config File).
Note:
If the selected Simulator for the current project has set a Platform IP Address other than localhost, this option is disabled.Managing HelloWorld sample
These steps show you how to manage the HelloWorld sample
application. The Java Card Plug-in for Eclipse must already be installed.
Start Eclipse. Java_Card_Simulator_1 must already be
created.
- Click the File menu, select Import >General > Projects
from Folder or Archive, and select the applet directory from the
HelloWorldproject to import theHelloWorldJava Card project into your workspace. If the build doesn't start automatically, start it manually - Start the
Java_Card_Simulator_1from Java Card View- Right-click on the
Java_Card_Simulator_1and press Start - From the drop-down button within the console, press
Connect
Note:
If theJava_Card_Simulator_1console is not selected automatically go to the Console View. In the Console View toolbar, use the Display Selected Console drop-down forJava_Card_Simulator_1.
- Right-click on the
- Check output of the console for successful connect by checking the response APDU (SW:9000)
- After a successful connect the drop-down menu will fill with the
commands needed for managing the
HelloWorldsample - From the drop-down menu select HelloWorld > CAP: HelloWorld > Load, Install, Select A00000006203010C01 A00000006203010C0101 (com.oracle.jcclassic.samples.helloworld.HelloWorld)
- Check that all commands were executed successfully. (SW:9000)
- Send the following APDU, from the
Java_Card_Simulator_1Console:CMD>0x80 0x20 0x00 0x05 0x31 0x32 0x33 0x34 0x35; - The response should look like this:
[APDU-R] 80200000053132333435 SW:9000