summaryrefslogtreecommitdiff
path: root/smcc/src/main/java/at/gv/egiz
diff options
context:
space:
mode:
Diffstat (limited to 'smcc/src/main/java/at/gv/egiz')
-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();