java.lang.Object | |
↳ | sun.security.pkcs11.Secmod |
The Secmod class defines the interface to the native NSS library and the configuration information it stores in its secmod.db file.
Example code:
Secmod secmod = Secmod.getInstance(); if (secmod.isInitialized() == false) { secmod.initialize("/home/myself/.mozilla", "/usr/sfw/lib/mozilla"); } Provider p = secmod.getModule(ModuleType.KEYSTORE).getProvider(); KeyStore ks = KeyStore.getInstance("PKCS11", p); ks.load(null, password);
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Secmod.DbMode | |||||||||||
Secmod.KeyStoreLoadParameter | A LoadStoreParameter for use with the NSS Softtoken or NSS TrustAnchor KeyStores. | ||||||||||
Secmod.Module | A representation of one PKCS#11 slot in a PKCS#11 module. | ||||||||||
Secmod.ModuleType | Constants describing the different types of NSS modules. | ||||||||||
Secmod.TrustType | Constants representing NSS trust categories. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return the singleton Secmod instance.
| |||||||||||
Returns the first module of the specified type.
| |||||||||||
Return an immutable list of all available modules.
| |||||||||||
Initialize this Secmod.
| |||||||||||
Test whether this Secmod has been initialized.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Returns the first module of the specified type. If no such module exists, this method returns null.
IllegalStateException | if this Secmod is misconfigured or not initialized |
---|
Return an immutable list of all available modules.
IllegalStateException | if this Secmod is misconfigured or not initialized |
---|
IOException |
---|
Initialize this Secmod.
configDir | the directory containing the NSS configuration files such as secmod.db |
---|---|
nssLibDir | the directory containing the NSS libraries (libnss3.so or nss3.dll) or null if the library is on the system default shared library path |
IOException | if NSS has already been initialized, the specified directories are invalid, or initialization fails for any other reason |
---|
Test whether this Secmod has been initialized. Returns true if NSS has been initialized using either the initialize() method or by directly calling the native NSS APIs. The latter may be the case if the current process contains components that use NSS directly.
IOException | if an incompatible version of NSS has been loaded |
---|