public class JniInitializer
extends java.lang.Object
For this class to be effective, it must be called before any of the Toolkit classes that require access to native libraries. Calling any of these classes before this one will cause the default library to be loaded, which must be installed on the library search path. For example,
PKCS11LibraryConnection p11Con = new PKCS11LibraryConnection("somep11lib.dll");
JniInitializer.initializePkcs11Library("c:\\somedir\\JNIPKCS11.dll");
will not be effective. It should be:
JniInitializer.initializePkcs11Library("c:\\somedir\\JNIPKCS11.dll");
PKCS11LibraryConnection p11Con = new PKCS11LibraryConnection("somep11lib.dll");| Modifier and Type | Method and Description |
|---|---|
static void |
initializeCapi()
Load the default CAPI native library.
|
static void |
initializeCapi(java.lang.String libraryPath)
Loads the CAPI native library from the given path.
|
static void |
initializePkcs11()
Load the default PKCS11 native library.
|
static void |
initializePkcs11(java.lang.String libraryPath)
Loads the Toolkit's PKCS11 native library from the given path.
|
static void |
initializeServerLogin()
Load the default Server Login native library.
|
static void |
initializeServerLogin(java.lang.String libraryPath)
Loads the Server Login native library from the given path.
|
static void |
initializeSingleLogin()
Load the default Single Login native library.
|
static void |
initializeSingleLogin(java.lang.String libraryPath)
Loads the Single Login native library from the given path.
|
static boolean |
isCapiInitialized()
Returns
true if the native CAPI library has been
successfully loaded and initialized, false
otherwise. |
static boolean |
isPkcs11Initialized()
Returns
true if the Toolkit's native PKCS11 library has been
successfully loaded and initialized, false
otherwise. |
static boolean |
isServerLoginInitialized()
Returns
true if the native Server Login library has been
successfully loaded and initialized, false
otherwise. |
static boolean |
isSingleLoginInitialized()
Returns
true if the Single Login native library has been
successfully loaded and initialized, false
otherwise. |
public static void initializeCapi()
throws java.lang.UnsatisfiedLinkError
Multiple initialization is not allowed, this method has no effect if the library has already been initialized successfully.
java.lang.UnsatisfiedLinkError - If the library cannot be loaded.public static void initializeCapi(java.lang.String libraryPath)
throws java.lang.UnsatisfiedLinkError
Multiple initialization is not allowed, this method has no effect if the library has already been initialized successfully.
libraryPath - Full path to the CAPI native library to load.java.lang.UnsatisfiedLinkError - If the specified library cannot be loaded.public static boolean isCapiInitialized()
true if the native CAPI library has been
successfully loaded and initialized, false
otherwise.true if the native CAPI library has been
successfully loaded and initialized, false
otherwise.public static void initializePkcs11()
throws java.lang.UnsatisfiedLinkError
Multiple initialization is not allowed, this method has no effect if the library has already been initialized successfully.
java.lang.UnsatisfiedLinkError - If the library cannot be loaded.public static void initializePkcs11(java.lang.String libraryPath)
throws java.lang.UnsatisfiedLinkError
Multiple initialization is not allowed, this method has no effect if the library has already been initialized successfully.
libraryPath - Full path to the PKCS11 native library to load.java.lang.UnsatisfiedLinkError - If the specified library cannot be loaded.public static boolean isPkcs11Initialized()
true if the Toolkit's native PKCS11 library has been
successfully loaded and initialized, false
otherwise.true if the Toolkit's native PKCS11 library has been
successfully loaded and initialized, false
otherwise.public static void initializeServerLogin()
throws java.lang.UnsatisfiedLinkError
Multiple initialization is not allowed, this method has no effect if the library has already been initialized successfully.
java.lang.UnsatisfiedLinkError - If the library cannot be loaded.public static void initializeServerLogin(java.lang.String libraryPath)
throws java.lang.UnsatisfiedLinkError
Multiple initialization is not allowed, this method has no effect if the library has already been initialized successfully.
libraryPath - Full path to the Server Login native library to load.java.lang.UnsatisfiedLinkError - If the specified library cannot be loaded.public static boolean isServerLoginInitialized()
true if the native Server Login library has been
successfully loaded and initialized, false
otherwise.true if the native Server Login library has been
successfully loaded and initialized, false
otherwise.public static void initializeSingleLogin()
throws java.lang.UnsatisfiedLinkError
Multiple initialization is not allowed, this method has no effect if the library has already been initialized successfully.
java.lang.UnsatisfiedLinkError - If the library cannot be loaded.public static void initializeSingleLogin(java.lang.String libraryPath)
throws java.lang.UnsatisfiedLinkError
Multiple initialization is not allowed, this method has no effect if the library has already been initialized successfully.
libraryPath - Full path to the Single Login native library to load.java.lang.UnsatisfiedLinkError - If the specified library cannot be loaded.public static boolean isSingleLoginInitialized()
true if the Single Login native library has been
successfully loaded and initialized, false
otherwise.true if the Single Login native library has been
successfully loaded and initialized, false
otherwise.