From 37be39f59c728cdcbdc60e6a10b04d59443fc98f Mon Sep 17 00:00:00 2001 From: tkellner Date: Tue, 7 Jan 2014 17:27:03 +0000 Subject: Move linux library detection git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@1275 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../main/java/at/gv/egiz/smcc/util/SMCCHelper.java | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/smcc/src/main/java/at/gv/egiz/smcc/util/SMCCHelper.java b/smcc/src/main/java/at/gv/egiz/smcc/util/SMCCHelper.java index 61bde48c..e4e11ea1 100644 --- a/smcc/src/main/java/at/gv/egiz/smcc/util/SMCCHelper.java +++ b/smcc/src/main/java/at/gv/egiz/smcc/util/SMCCHelper.java @@ -57,8 +57,19 @@ public class SMCCHelper { protected static boolean useSWCard = false; public SMCCHelper() { - - System.setProperty("sun.security.smartcardio.t0GetResponse", "false"); + + String osName = System.getProperty("os.name"); + if (osName.startsWith("Linux")) { + File libFile; + try { + libFile = LinuxLibraryFinder.getLibraryPath("pcsclite", "1"); + System.setProperty("sun.security.smartcardio.library", libFile.getAbsolutePath()); + } catch (FileNotFoundException e) { + log.error("PC/SC library not found", e); + } + } + + System.setProperty("sun.security.smartcardio.t0GetResponse", "false"); update(); } @@ -80,17 +91,6 @@ public class SMCCHelper { return; } - String osName = System.getProperty("os.name"); - if (osName.startsWith("Linux")) { - File libFile; - try { - libFile = LinuxLibraryFinder.getLibraryPath("pcsclite", "1"); - System.setProperty("sun.security.smartcardio.library", libFile.getAbsolutePath()); - } catch (FileNotFoundException e) { - log.error("PC/SC library not found", e); - } - } - signatureCard = null; resultCode = NO_CARD; // find pcsc support -- cgit v1.2.3