On 11/23/2011 3:07 PM, Anders Rundgren wrote: > Hi, > I just wonder what your opinion is about Java smart card io which is a > part of JDK 1.6 and forward. > > I did a minute test and it wasn't overly convincing :-( > > OTOH, as we all know that smart card middle ware is "hell on earth" I > may simple haven't given it enough time. > > import javax.smartcardio.*; > import java.util.List; > > public class smart > { > public static void main (String[] args) > { > try > { > // show the list of available terminals > TerminalFactory factory = TerminalFactory.getDefault(); > List<CardTerminal> terminals = factory.terminals().list(); > > // get the first terminal > if (terminals.isEmpty ()) > { > System.out.println ("No terminals found!"); > } > else > { > System.out.println("Terminals: " + terminals); > CardTerminal terminal = terminals.get(0); > // establish a connection with the card > Card card = terminal.connect("T=0"); > System.out.println("card: " + card); > CardChannel channel = card.getBasicChannel(); > // disconnect > card.disconnect(false); > } > } > catch (Exception e) > { > e.printStackTrace (); > } > } > } > > On windows you get an exception if there is no reader connected! > On Ubuntu I always get No terminals found! > > On both machines I have other smart card apps working including pcscd on > Ubuntu > that in debug mode shows that the card is connected etc. > > javax.smartcardio.* = Total crap IMNSHO.
Does this help: http://docs.oracle.com/javase/6/docs/technotes/guides/security/SunProviders.html#SunPCSCProvider "The system property sun.security.smartcardio.library may also be set to the full filename of an alternate libpcsclite.so implementation." > > Anders > > _______________________________________________ > opensc-devel mailing list > opensc-devel@lists.opensc-project.org > http://www.opensc-project.org/mailman/listinfo/opensc-devel > > -- Douglas E. Engert <deeng...@anl.gov> Argonne National Laboratory 9700 South Cass Avenue Argonne, Illinois 60439 (630) 252-5444 _______________________________________________ opensc-devel mailing list opensc-devel@lists.opensc-project.org http://www.opensc-project.org/mailman/listinfo/opensc-devel