31 import java.security.AccessController; 32 import java.security.PrivilegedAction; 33 34 import sun.security.util.Debug; 35 36 /** 37 * Platform specific code and functions for Unix / MUSCLE based PC/SC 38 * implementations. 39 * 40 * @since 1.6 41 * @author Andreas Sterbenz 42 */ 43 class PlatformPCSC { 44 45 static final Debug debug = Debug.getInstance("pcsc"); 46 47 static final Throwable initException; 48 49 private final static String PROP_NAME = "sun.security.smartcardio.library"; 50 51 private final static String LIB1 = "/usr/$LIBISA/libpcsclite.so"; 52 private final static String LIB2 = "/usr/local/$LIBISA/libpcsclite.so"; 53 54 PlatformPCSC() { 55 // empty 56 } 57 58 static { 59 initException = AccessController.doPrivileged(new PrivilegedAction<Throwable>() { 60 public Throwable run() { 61 try { 62 System.loadLibrary("j2pcsc"); 63 String library = getLibraryName(); 64 if (debug != null) { 65 debug.println("Using PC/SC library: " + library); 66 } 67 initialize(library); 68 return null; 69 } catch (Throwable e) { 70 return e; 71 } 72 } | 31 import java.security.AccessController; 32 import java.security.PrivilegedAction; 33 34 import sun.security.util.Debug; 35 36 /** 37 * Platform specific code and functions for Unix / MUSCLE based PC/SC 38 * implementations. 39 * 40 * @since 1.6 41 * @author Andreas Sterbenz 42 */ 43 class PlatformPCSC { 44 45 static final Debug debug = Debug.getInstance("pcsc"); 46 47 static final Throwable initException; 48 49 private final static String PROP_NAME = "sun.security.smartcardio.library"; 50 51 private final static String LIB1 = "/usr/$LIBISA/libpcsclite.so.1"; 52 private final static String LIB2 = "/usr/local/$LIBISA/libpcsclite.so.1"; 53 54 PlatformPCSC() { 55 // empty 56 } 57 58 static { 59 initException = AccessController.doPrivileged(new PrivilegedAction<Throwable>() { 60 public Throwable run() { 61 try { 62 System.loadLibrary("j2pcsc"); 63 String library = getLibraryName(); 64 if (debug != null) { 65 debug.println("Using PC/SC library: " + library); 66 } 67 initialize(library); 68 return null; 69 } catch (Throwable e) { 70 return e; 71 } 72 } |