Forum Stats

  • 3,838,487 Users
  • 2,262,373 Discussions
  • 7,900,671 Comments

Discussions

javax.smartcardio do not work on linux 64 bit (OEL6)

cristianoburgo
cristianoburgo Member Posts: 4
edited Apr 27, 2014 10:55AM in Cryptography

I wrote the below code to read the attached Smartcard reader on a system. This code work fine for a Windows system but on a Linux the smartcard reader are not detected. The JVM used is Oracle Jre 1.7.0.55, the pcsc_lite is installed and with the command lsusb i see the smartcard reader.

I have also exceuted the code using : java -Dsun.security.smartcardio.library=/usr/lib64/libpcsclite.so.1.0.0 -jar software.jar

But the reader is not detected.

The Code:

int ireader;

TerminalFactory factory = TerminalFactory.getDefault();

List terminals = factory.terminals().list();

ireader = terminals.size();

return ireader;

Any suggestion ?

Answers

  • cristianoburgo
    cristianoburgo Member Posts: 4
    edited Apr 27, 2014 11:30AM

    Found a solution for another distribution but this can help.

    Starting from a fresh installation of UBUNTU 12.04 64 bit then i installed :

    - libccid

    - libpcsclite1

    - pcscd

    after that i found the library libpcsclite.so.1  in: /lib/x86_64-Linux-gnu

    so to execute the code you need to tell java where is this library using -Dsun.security.smartcardio.library .

    the final command is:

    java -Dsun.security.smartcardio.library=/lib/x86_64-Linux-gnu/libpcslite.so.1 -jar software.jar

    cristianoburgo
This discussion has been closed.