| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
pkcs11ModuleName = "libetpkcs11.so" in /usr/local/lib
/**
* Get an instance of this class by giving the name of the PKCS#11 module;
* e.g. "slbck.dll".
*
* @param pkcs11ModuleName The name of the module; e.g. "slbck.dll".
* @return An instance of Module that is connected to the given PKCS#11
* module.
* @exception IOException If connecting to the named module fails.
* @preconditions (pkcs11ModuleName <> null)
* and (pkcs11ModuleName is a valid PKCS#11 module name)
* @postconditions
*/
public static Module getInstance(String pkcs11ModuleName)
throws IOException
{
if (pkcs11ModuleName == null) {
throw new NullPointerException("Argument \"pkcs11ModuleName\" must not be null.");
}
PKCS11 pkcs11Module = PKCS11Connector.connectToPKCS11Module(pkcs11ModuleName);
return new Module(pkcs11Module) ;
}
*-----------------------------------------------------------------------------------------------------*
The getInstance() calls the connectToPKCS11Module() of PKCS11Connector class
/**
* Connect to a PKCS#11 module and get an interface to it.
*
* @param pkcs11ModulePath The path to the PKCS#11 library.
* @return The interface object to access the PKCS#11 module.
* @exception IOException If finding the module or connecting to it fails.
*/
public static PKCS11 connectToPKCS11Module(String pkcs11ModulePath)
throws IOException
{
return new PKCS11Implementation(pkcs11ModulePath);
}
*-----------------------------------------------------------------------------------------------------*
Inturn creates an Object of PKCS11Implementation class
/**
* Connects to the PKCS#11 driver given. The filename must contain the
* path, if the driver is not in the system's search path.
*
* @param pkcs11ModulePath the PKCS#11 library path
* @exception IOException If linking to the given module failed.
* @preconditions (pkcs11ModulePath <> null)
* @postconditions
*/
PKCS11Implementation(String pkcs11ModulePath)
throws IOException
{
ensureLinkedAndInitialized();
connect(pkcs11ModulePath);
pkcs11ModulePath_ = pkcs11ModulePath;
}
*------------------------------------------------------------------------------------------------------*
PKCS11Implementation class calls ensureLinkedAndInitialized() method and this is the method responsible for loading
the "libpkcs11wrapper.jnilib" file that in the
Users' home /Library/Java/Extensions folder as suggested.
/**
* This method ensures that the library is linked to this class and that it
* is initialized.
*
* @preconditions
* @postconditions
*/
public static synchronized void ensureLinkedAndInitialized() {
if (!linkedAndInitialized_) {
/* We do not call loadLibrary in a static initializer to allow better use in
* applets. Static initialization blocks have a differrent security context.
*/
System.loadLibrary(PKCS11_WRAPPER);
initializeLibrary();
linkedAndInitialized_ = true;
}
}
------------------------------------------------------------------------------------------------------------
Wondering if this comment makes any difference
/* We do not call loadLibrary in a static initializer to allow better use in
* applets. Static initialization blocks have a differrent security context.
*/
System.loadLibrary(PKCS11_WRAPPER);
where PKCS11_WRAPPER = "pkcs11wrapper" and "libpkcs11wrapper.jnilib" is in users' home /Library/Java/Extensions (created this new folder, wasn't there before)
_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden This email sent to email@hidden
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.