2 Installation

This chapter describes the software that you must install on your system before you can use the development kit, how to install the development kit, how to check system variables, and how to uninstall the development kit. It also describes how to install and setup the Eclipse Plug-in.

The development kit is available as three independent downloads:

This chapter contains the following sections:

Install and Setup the Java Card Development Kit Simulator

The Java Card Development Kit Simulator provides an environment for developing, testing, and debugging Java Card applications. It includes a Java Card simulation environment that supports the latest Java Card 3.2 Specification and can also run applications written for earlier releases.

This section describes how to install and set up the Java Card Development Kit Simulator. It includes procedures for performing the following tasks:

Before Installing the Java Card Development Kit Simulator

This product runs on PCs with the following operating systems:

Before installing the Java Card Development Kit Simulator, be sure to install the following software:

Linux - Install and Set Up the PCSC-Lite and IFD Handler

The Java Card Development Kit Simulator works with smart card terminals in Linux operating system by using the PCSC-Lite and the IFD Handler. The Java Card Development Kit Simulator bundle for Linux comes with the IFD Handler library.

The following steps explain how to set up and configure the IFD Handler library (libjcsdkifdh.so), located in the /<absolute-path-to-jc-simulator>/drivers/IFDHandler/ directory, and use it with multiple Simulator instances.

  1. Install PCSC-Lite on your operating system following the instructions presented here: https://pcsclite.apdu.fr.

    Note:

    The installation process might differ depending on OS and version of PCSC-Lite.

  2. Install pcsc tools on your operating system following the instructions presented here: https://pcsc-tools.apdu.fr.

    Note:

    The installation process might differ depending on OS and version of pcsc-tools.

  3. Create a new file named jcsdk_config in the PC/SC Daemon default configuration directory named /etc/reader.conf.d: sudo touch /etc/reader.conf.d/jcsdk_config

  4. Add a maximum of 7 reader configurations for the IFD-Handler implementation library named libjcsdkifdh.so, in the above-mentioned configuration file - jcsdk_config. An example for two reader configurations is described below:

    # Configuration example of two readers to interact with the
    # Oracle PCSC Reader for Linux
    
    FRIENDLYNAME Oracle_Java_Card_PCSC_Reader_0
    DEVICENAME 127.0.0.1:9025
    LIBPATH /<absolute-path-to-jc-simulator>/drivers/IFDHandler/libjcsdkifdh.so
    
    FRIENDLYNAME Oracle_Java_Card_PCSC_Reader_1
    DEVICENAME 127.0.0.1:9026
    LIBPATH /<absolute-path-to-jc-simulator>/drivers/IFDHandler/libjcsdkifdh.so

    Note:

    It is advised to use only alphanumerical characters for the reader names.

    Note:

    The PCSC-Lite daemon will act as socket client for the Java Card Simulator (jcsl) started on the ports configured in this file and connect to them so other socket clients can not connect to these runtimes on those ports.

  5. Make PC/SC Daemon aware of the new configuration for the IFD-Handler. To load the new configuration file created at the previous step, PC/SC Daemon must be restarted, use the following command:

    sudo systemctl restart pcscd
    sudo systemctl restart pcscd.socket
    • Use the following command to start the PC/SC Daemon in foreground mode for debug purposes:

      sudo pcscd -f -d -a

      Note:

      To verify that the pcscd configuration is reflected in the new daemon, run pcsc_scan to list the available readers. Both “Oracle_Java_Card_PCSC_Reader_0” and “Oracle_Java_Card_PCSC_Reader_1” should be present in the list if the previous configuration file example was used.

  6. Repeat the following steps as many times as the number of configured readers to start multiple simulator instances, each using a different port as configured in the jcsdk_config file.

    Note:

    For running the Java Card Simulator, please refer to the prerequisites found in Before Installing the Java Card Development Kit Simulator.

    cd ${JC_HOME_SIMULATOR}/runtime/bin
    ./jcsl -p=<port>

    Note:

    For command line parameters, see Running the Simulator and the Samples section in the Java Card Development Kit Simulator Command Line section.

  7. The PC/SC daemon setup is complete.

Linux - Configure Linux Operating Systems to Run 32-bit Applications

The following steps configure Linux Ubuntu and Linux Oracle to run 32-bit applications:

Windows – Install and Set Up the PC/SC Driver (optional)

This section describes how to install, configure, and manage the Oracle Java Card PC/SC driver to enable communication with the Oracle Java Card Development Kit Simulator on Windows.

The package includes several files, each with a specific role in the driver setup.

Package Contents and File Descriptions

File Purpose
jcdkPCSC.cat (Catalog File) Provides digital signatures that verify the authenticity and integrity of the driver package. Ensures security and compliance during installation.
jcdkPCSC.sys (System File) The core device driver that enables communication between Windows and the Oracle Java Card Development Kit Simulator.
jcdkPCSC.inf (Information File) Contains installation instructions for the simulated smart card reader device.
jcdkPCSCCtrl.exe (Driver Controller Application) A command-line tool to install, uninstall, and configure the PCSC driver, replacing and extending Windows Device Manager actions for this device.

Driver Controller Application Commands

Command Description
install <ip> <port> Installs the PC/SC driver (adds a reader device to Windows, visible as “Oracle Java Card PCSC Reader” under Smart Card Readers in Device Manager.

Note: <ip> must be the simulator IP address. (e.g. `127.0.0.1`). <port> must be the simulator port (e.g. `9025`). The reader will appear in Windows Device Manager as Oracle Java Card PCSC Reader under Smart Card Readers.
Starting with version 26.1, up to 10 reader instances are supported. Driver instances from releases earlier than 26.1 are no longer supported and are automatically removed when present.

uninstall [identifier] Uninstalls all Oracle Java Card PC/SC Reader instances, or the instance identified by [identifier]. Use the list command to obtain the reader index. If [identifier] is omitted, removes all Oracle Java Card PC/SC Reader instances.
list Lists all the Oracle PC/SC card readers.

Install PC/SC Driver

Pre-requisites

Note:

Administrator privileges are required to install system drivers. All commands must be run from an elevated Command Prompt.

  1. Open a Command Prompt as Administrator.

    Navigate to the drivers/PCSC folder where the Oracle Java Card Development Kit Simulator package was installed.

    cd drivers\PCSC
  2. Install the PC/SC reader.

    Use the Driver Controller application to install the core PC/SC reader. This registers a new PC/SC reader device, visible as Oracle Java Card PCSC Reader in the Smart Card Readers category in Windows Device Manager.

    jcdkPCSCCtrl.exe install 127.0.0.1 9025
    jcdk PCSC Controller v26.1
    New reader installed

    Note:

    Multiple readers may be added in the current version (up to 10 reader instances).

    The reader will appear in Device Manager as Oracle Java Card PCSC Reader under Smart Card Readers.

  3. List the installed PC/SC readers.

    Use the Driver Controller application to list the installed PC/SC readers.

    jcdkPCSCCtrl.exe list
    jcdk PCSC Controller v26.1
    Installed PC/SC readers :
    Index Reader name                                   Ip                   Port
    ----- -----------                                   ------               --------
    0     Oracle Java Card PCSC Reader 0                127.0.0.1            9025
    1     Oracle Java Card PCSC Reader 1                127.0.0.15           9026

Uninstall PC/SC Driver

Note:

Administrator privileges are required to install system drivers. Run all commands from an elevated Command Prompt in the PC/SC Driver folder of your JCDK bundle.

There are multiple ways to uninstall the driver:

If you plan to install a newer version of the driver, we recommend performing the cleanup operations described at the end of this section.

Uninstall using the Oracle Driver Controller Application (Preferred)

  1. Open a Command Prompt as Administrator and navigate to the driver directory.

    Navigate to the drivers/PCSC folder where the Oracle Java Card Development Kit Simulator package was installed.

    cd drivers\PCSC
  2. List the current installed readers.

    jcdkPCSCCtrl.exe list
    jcdk PCSC Controller v26.1
    Installed PC/SC readers :
      Index Reader name                                   Ip                   Port
      ----- -----------                                   ------               --------
      0     Oracle Java Card PCSC Reader 0                127.0.0.1            9025
      1     Oracle Java Card PCSC Reader 1                127.0.0.15           9026
  3. Uninstalling the simulated reader(s).

Note:

The uninstall command syntax is as follows: jcdkPCSCCtrl.exe uninstall [identifier] Use no [identifier] if you want to remove all the installed readers.

Use the Driver Controller application to remove one of the installed readers. The [identifier] must match the reader index you previously listed with the list command.

jcdkPCSCCtrl.exe uninstall 1
jcdk PCSC Controller v26.1
Removing reader Oracle Java Card PCSC Reader 1... DONE.

Use the Driver Controller application to uninstall all the PC/SC reader instances.

jcdkPCSCCtrl.exe uninstall
jcdk PCSC Controller v26.1
Removing reader Oracle Java Card PCSC Reader 0... DONE.

Use the Driver Controller application to list all the PC/SC reader instances.

jcdkPCSCCtrl.exe list
jcdk PCSC Controller v26.1
Installed PC/SC readers :
Index Reader name                                   Ip                   Port
----- -----------                                   ------               --------
No readers were found.

Uninstall using Windows Device Manager

In Device Manager, find and right-click Oracle Java Card PCSC Reader under Smart Card Readers, then select Uninstall device.

This will uninstall the associated PC/SC Reader.

Cleanup using Windows PnPUtil Application

When you uninstall a device, Windows may only remove the device instance, not the driver files from the Driver Store. If the device is re-added, Windows can silently reinstall the same driver. To fully remove a problematic or outdated driver and prevent automatic reinstallation, execute the following steps in a PowerShell console opened as Administrator:

Remove the SmartCardReader device instances.

pnputil /enum-drivers /class SmartCardReader

Review the output for a section similar to:


Published Name:    oemXXX.inf
Original Name:     jcdkpcsc.inf
Provider Name:     Oracle
Class Name:        SmartCardReader
Class GUID:        {50dd5230-ba8a-11d1-bf5d-0000f805f530}
Driver Version:    ...
Signer Name:       Microsoft Windows Hardware Compatibility Publisher

Then run:

pnputil /delete-driver oemXXX.inf /uninstall

Known Limitations and Issues

Troubleshooting

Installing the Java Card Development Kit Simulator

Follow these steps to install the Java Card Development Kit Simulator.

The Java Card Development Kit Simulator is available for download at Java Card downloads.

  1. Download the Java Card Development Kit Simulator archive file to a directory of your choice. It is available in the .zip file for Windows and .tar.gz for Linux.
    • java_card_devkit_simulator-win-bin-v[version]-buildID-dd-mmm-yyy.zip
    • java_card_devkit_simulator-linux-bin-v[version]-buildID-dd-mmm-yyy.tar.gz
  2. Extract the downloaded archive file to the directory of your choice.

    Note:

    The installation directory of the Java Card Development Kit Simulator is referred to as JC_HOME_SIMULATOR throughout this documentation.

When the Java Card Development Kit Simulator has been installed, proceed to:

  1. Optional, but recommended, install the Java Card Plug-in for Eclipse. See Installing the Eclipse Plug-in

  2. Examine and run the samples. See Running the Simulator and the Samples

Installed Files and Directories

If you have installed the Java Card Development Kit Simulator and the Java Card Development Kit Tools, the installation directory of the Simulator is referred to by the environment variable JC_HOME_SIMULATOR and the installation directory of the Tools is referred to by the environment variable JC_HOME_TOOLS in this guide. All files and directories contained in the Simulator bundle are installed in JC_HOME_SIMULATOR. In the same way, all files and directories contained in the Tools bundle are installed JC_HOME_TOOLS.

Verifying the System Variables

Certain system variables are set during the installation process. If you are not able to build samples from the command line, or if something seems to be wrong with the Eclipse Plug-in operation, verify that the following variables and paths are set correctly:

Configure Access to the OpenSSL Library

OpenSSL is a software library that provides cryptographic functionality upon which the Java Card Development Kit is built and run.

This section describes how to configure the access to the OpenSSL shared library (32-bit) delivered within the Java Card Development Kit Simulator. Please make sure that the operating system is configured to run 32 bit applications.

Configure OpenSSL on Linux

For the Simulator to access the OpenSSL shared library, follow these steps:

Configure OpenSSL on Windows

Nothing is required here since the simulator executable (jcsw.exe) will use by default the OpenSSL shared library (32-bit) delivered in the same directory (%JC_HOME_SIMULATOR%\runtime\bin).

It is worth noting that, by default, the legacy provider (legacy.dll) for “weak SSL ciphers” (like”single DES”) is present. It may be suppressed from this directory if the user is not willing to support the legacy provider.

Configuring the Java Card Development Kit Simulator

Before using the simulator for the first time, it must be provisioned with an initial Secure Channel Protocol key set and with a Global PIN.

This can be done by running the Configurator tool from the command line as follows:

java -jar Configurator.jar -binary <simulator-binary> -SCP-keyset <kvn> <k_enc> <k_mac> <k_dek> -global-pin <pin> <tries_count>

where:

Note:

The Configurator.jar file is located in the tools sub-directory of JC_HOME_SIMULATOR. To print the available arguments and further details of the configurator, execute java -jar Configurator.jar

Here are examples on how to provision the simulator using the Configurator. Use your own values accordingly.

Example - Linux (values must be set with yours):

java -jar ${JC_HOME_SIMULATOR}/tools/Configurator.jar -binary ${JC_HOME_SIMULATOR}/runtime/bin/jcsl -SCP-keyset 10 1111111111111111111111111111111111111111111111111111111111111111 2222222222222222222222222222222222222222222222222222222222222222 3333333333333333333333333333333333333333333333333333333333333333 -global-pin 01020304050f 03

Example - Windows (values must be set with yours):

java -jar %JC_HOME_SIMULATOR%\tools\Configurator.jar -binary %JC_HOME_SIMULATOR%\runtime\bin\jcsw.exe -SCP-keyset 10 1111111111111111111111111111111111111111111111111111111111111111 2222222222222222222222222222222222222222222222222222222222222222 3333333333333333333333333333333333333333333333333333333333333333 -global-pin 01020304050f 03

Uninstalling the Java Card Development Kit Simulator

To uninstall the Java Card Development Kit Simulator, do the following:

  1. Start Eclipse and remove the Java Card Plug-in:
    1. From the Eclipse Help menu, select About Eclipse.
    2. On the Installed Software tab, select Java Card 3 Platform Development Kit.
    3. Click Uninstall… and follow the prompts.
  2. Delete the JC_HOME_SIMULATOR directory from your hard drive, if required.