将PKCS11与NSS一起用于Java加密:java.security.ProviderException:初始化失败

时间:2014-12-18 05:42:41

标签: java ioexception pkcs#11 nss

我正在尝试设置Java以使用NSS来执行各种加密例程。我理解将这些例程卸载到NSS所需的JCE是PKCS11。我编译了所有NSS二进制文件,并将每个生成的共享对象移动到/ usr / lib / nss:

$ ls /usr/lib/nss/
libfreebl3.so  libnss3.so     libnssdbm3.so     libnssutil3.so  libplds4.so   libsoftokn3.so
libnspr4.so    libnssckbi.so  libnsssysinit.so  libplc4.so      libsmime3.so  libsqlite3.so

我使用的nss.cfg文件如下:

name=NSS
nssLibraryDirectory=/usr/lib/nss
nssDbMode=noDb
attributes=compatibility

但是,在运行应用程序时,这是输出:

java.security.ProviderException: Initialization failed
    at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:376)
    at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:103)
    ...
Caused by: java.io.IOException: libsqlite3.so: cannot open shared object file: No such file or directory/usr/lib/nss/libsoftokn3.so
    at sun.security.pkcs11.wrapper.PKCS11.connect(Native Method)
    at sun.security.pkcs11.wrapper.PKCS11.<init>(PKCS11.java:138)
    at sun.security.pkcs11.wrapper.PKCS11.getInstance(PKCS11.java:151)
    at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:313)
    ... 5 more

任何想法???

0 个答案:

没有答案