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.

These are the steps to setup and configure the IFD Handler library named libjcsdkifdh.so located in the /<absolute-path-to-jc-simulator>/drivers/IFDHandler/ directory, and how to 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. PC/SC Daemon setup is finished.