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.

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.

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.

The error is:

```
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

```

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.