Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SunPKCS11 and NSS 3.11.4

843811Oct 29 2009 — edited Nov 3 2009
Initializing SunPKCS11 for utilization of NSS 3.11.4 capabilities yields the following exception:
java.security.ProviderException: Could not initialize NSS
	at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:183)
	at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:90)
	at test.TripleDESTest.main(TripleDESTest.java:112)
Caused by: java.io.IOException: The specified version of NSS is incompatible, 3.7 or later required
	at sun.security.pkcs11.Secmod.initialize(Secmod.java:190)
	at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:179)
	... 2 more
The version I am using is greater than 3.7, despite what the exception says. I am looking to use the FIPS 140-2 certified symmetric key algorithms in this library.

I am using the following configuration:
name = NSScrypto
attributes = compatibility
nssLibraryDirectory = ./lib
nssDbMode = noDb
nssModule = fips
I am adding the cryptography provider dynamically with the following code:
String configName = "nss.cfg";
Provider cryptoProvider = new sun.security.pkcs11.SunPKCS11(configName);  // exception occurs on this line
Security.addProvider(cryptoProvider);
Has anyone else run into this issue or have any insight into the problem?

Thanks!

Edited by: dmorriscdm on Oct 29, 2009 5:44 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 1 2009
Added on Oct 29 2009
4 comments
2,067 views