7

Is there is a library (API) in Java with which I can interact with a smart card? Similar to the WinSCard library.

I need to be able to connect with the smart card and read data from it. I need to implement it in Java so that I can use it under any OS (Linux, Mac, Windows). Since, the WinSCard library only works under Windows because it uses a DLL (WinSCard.dll).

Is there anything as good as WinSCard in Java?

MJay
  • 987
  • 1
  • 13
  • 36
Q8Y
  • 3,801
  • 12
  • 39
  • 38

3 Answers3

8

One of the solutions is to use Java™ Smart Card I/O API. See the "Description" section for a simple usage example.

informatik01
  • 16,038
  • 10
  • 74
  • 104
jmones
  • 89
  • 1
  • 3
  • +1. There is an API example at the end of that page which is really helpful. – Mohammad Banisaeid Nov 05 '12 at 11:06
  • how can you get this api ? im currently using jre7 – ralphgabb Jul 14 '15 at 07:27
  • @ralphspoon This API is available with a JDK installation (since Java version 6). So first, you need to have [JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html) installed ([What is the difference between JDK and JRE?](http://stackoverflow.com/questions/1906445/what-is-the-difference-between-jdk-and-jre)). Second, add related imports at the top of your Java file (or import everything, e.g. `import javax.smartcardio.*;`) – informatik01 Jan 07 '16 at 14:36
1

PC/SC specification as a reader and a satandard interface between card and computer.Open the VC support PC/SC standard key header file WinScard.h. With java can call the PC/SC of VC.As a middle way to solve you problems.

1

The basic API is the Smartcard IO, which offer basic operation to send APDU to the card. After this, there is several higher API available. For instance, if you need to connect to a JavaCard to manage applet, you need a Global Platform implementation, for instance the Opal Library (Shameless Self-promotion).

Kartoch
  • 7,610
  • 9
  • 40
  • 68