From 890c3c0d321c3b59ec1224d4630b3f2401ef94e7 Mon Sep 17 00:00:00 2001 From: tkellner Date: Tue, 7 Jan 2014 17:28:54 +0000 Subject: Add custom PC/SC library for MacOS X from OpeneCard project git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@1276 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- smcc/src/main/java/at/gv/egiz/smcc/util/SmartCardIO.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'smcc/src/main/java/at') diff --git a/smcc/src/main/java/at/gv/egiz/smcc/util/SmartCardIO.java b/smcc/src/main/java/at/gv/egiz/smcc/util/SmartCardIO.java index 08a1ea39..b646fb0a 100644 --- a/smcc/src/main/java/at/gv/egiz/smcc/util/SmartCardIO.java +++ b/smcc/src/main/java/at/gv/egiz/smcc/util/SmartCardIO.java @@ -37,9 +37,11 @@ import javax.smartcardio.CardTerminals; import javax.smartcardio.TerminalFactory; import javax.smartcardio.CardTerminals.State; +import org.openecard.scio.osx.SunOSXPCSC; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + /** * * @author mcentner @@ -65,7 +67,12 @@ public class SmartCardIO { private void updateTerminalFactory() { TerminalFactory terminalFactory; try { - terminalFactory = TerminalFactory.getInstance("PC/SC", null); + String osName = System.getProperty("os.name"); + if (osName.contains("OS X")) { + terminalFactory = TerminalFactory.getInstance("PC/SC", null, new SunOSXPCSC()); + } else { + terminalFactory = TerminalFactory.getInstance("PC/SC", null); + } } catch (NoSuchAlgorithmException e) { log.info("Failed to get TerminalFactory of type 'PC/SC'.", e); terminalFactory = TerminalFactory.getDefault(); -- cgit v1.2.3