summaryrefslogtreecommitdiff
path: root/smcc/src/main/java/at/gv
diff options
context:
space:
mode:
authortkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2014-01-07 17:28:54 +0000
committertkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2014-01-07 17:28:54 +0000
commit890c3c0d321c3b59ec1224d4630b3f2401ef94e7 (patch)
treea57134ee8db0c8b8382ce186886b3d93b1265836 /smcc/src/main/java/at/gv
parent37be39f59c728cdcbdc60e6a10b04d59443fc98f (diff)
downloadmocca-890c3c0d321c3b59ec1224d4630b3f2401ef94e7.tar.gz
mocca-890c3c0d321c3b59ec1224d4630b3f2401ef94e7.tar.bz2
mocca-890c3c0d321c3b59ec1224d4630b3f2401ef94e7.zip
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
Diffstat (limited to 'smcc/src/main/java/at/gv')
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/util/SmartCardIO.java9
1 files changed, 8 insertions, 1 deletions
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();