使用 sun.security.pkcs11.SunPKCS11 的奇怪问题:找不到指定的程序? [英] Weird problem using sun.security.pkcs11.SunPKCS11: The specified procedure could not be found?

查看:34
本文介绍了使用 sun.security.pkcs11.SunPKCS11 的奇怪问题:找不到指定的程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发这个应用程序,专门用于 Firefox(供内部使用).基本上,我们使用 sun.security 来读取 Firefox 的 KeyStore 并使用我们获得的证书签署数据.

I'm developing this application to be used speceifically with Firefox (it's for internal use). Basically, we're using the sun.security stuff to read Firefox's KeyStore and sign data with the certs we get.

我已经在多台机器上测试过,结果各不相同,我似乎无法确定原因.

I've tested this on several machines and the results are varying, I can't seem to pinpoint the reason.

我已经在最新的 ubuntu 版本 Firefox 3.6.13 上测试过它,使用 Java 版本 1.6.0_22,它在那里工作.我还有一台装有相同 Firefox 版本的 Windows XP 笔记本电脑,使用 Java 版本 1.6.0_17,它也能正常工作.

I've tested it on the latest ubuntu release, Firefox 3.6.13, using Java version 1.6.0_22, it works there. I also have a Windows XP laptop with the same Firefox version using Java version 1.6.0_17, where it works as well.

还有其他 2 台 Windows XP 笔记本电脑无法运行,出现同样的错误.他们运行相同版本的 Firefox 并使用 Java 版本 1.6.0_17.

There are 2 other Windows XP laptops that it will not work on, giving the same error. They're running the same version of Firefox and using java version 1.6.0_17.

错误是:

java.security.ProviderException: Could not initialize NSS
    at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:183)
    at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:86)
    at SignedMessage.SigningApplet.initializeCrypto(SigningApplet.java:327)
    at SignedMessage.SigningApplet.init(SigningApplet.java:84)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: The specified procedure could not be found.
    at sun.security.pkcs11.Secmod.nssLoadLibrary(Native Method)
    at sun.security.pkcs11.Secmod.initialize(Secmod.java:186)
    at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:179)
    ... 5 more
Exception: java.security.ProviderException: Could not initialize NSS

据我所知,它找不到本机 nssLoadLibrary 例程?配置文件将其指向 Firefox 安装目录(它可以在其中获取 nss3.dll 或 libnss3.so 文件).它在所有 PC 上执行此操作,并且配置中的所有路径似乎都有效.

From what I can tell it can't find the native nssLoadLibrary routine? The configuration file is pointing it to the Firefox install directory (where it can grab the nss3.dll or libnss3.so file). It does this across all pc's and all the paths in the configuration seem to be valid.

示例配置文件,物有所值:

A sample config file, for what it's worth:

name=NSS
nssDbMode=readOnly
nssModule=keystore
nssSecmodDirectory="C:\\Documents and Settings\\user\\Application     Data\\Mozilla\\firefox\\Profiles/8bzd2qqm.default"
nssLibraryDirectory=C:\Program Files\Mozilla Firefox

我希望有人能提供线索,或者一些关于进一步调试的提示.我在这里不知所措.

I was hoping someone would have a clue, or maybe some tips on getting further with debugging. I'm at a loss here.

推荐答案

我可能为时已晚,无法对您有用,但我遇到了类似的问题,并添加了 dist\WINXXX_DBG.OBJ\lib 到我的 PATH 解决了这个问题.

I'm likely much too late for this to be of use to you, but I was having similar problems, and adding dist\WINXXX_DBG.OBJ\lib to my PATH resolved this issue.

这篇关于使用 sun.security.pkcs11.SunPKCS11 的奇怪问题:找不到指定的程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆