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.
- 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. - 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. - Create a new file named
jcsdk_configin the PC/SC Daemon default configuration directory named/etc/reader.conf.d:sudo touch /etc/reader.conf.d/jcsdk_config - 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.soNote:
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. - 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 -aNote:
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.
- Use the following command to start the PC/SC Daemon in
foreground mode for debug
purposes:
- 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_configfile.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. - PC/SC Daemon setup is finished.