Java – NSS shared database cannot be used with sunpkcs11
I have used the sunpkcs11 provider in FIPS mode to convert NSS 3.12 4 configured to use my java program, everything is fine Now I follow https://blogs.oracle.com/meena/entry/what_s_new_in_nss1 The steps mentioned in make NSS work as a shared database
When I configure NSS in shared database mode, secmod The DB file will be replaced with pkcs11.0 as expected txt. However, sunpkcs11 cannot initialize now because secmod appears to have been checked during initialization db. I also tried to use the SQL prefix configdir, but it didn't work
I got the following exception
Caused by: java.io.FileNotFoundException: /etc/nss/secmod.db at sun.security.pkcs11.Secmod.initialize(Secmod.java:181) at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:179)
Has anyone tried NSS to share a database with Java or solve this problem in any way?
Solution
To make this useful to me, I took two more steps
>Use touch to create an empty secmod DB - Java code just checks if it exists, it doesn't actually use it. > Start the java process' export NSS_ DEFAULT_ DB_ Set the default database type before type = SQL '
With these two changes, I now have a server - side process that uses NSS to load its keys