secmod.db doesn't list my external tokens and cannot get access in Java

Ding Yangliang <[email protected]>
Newsgroups gmane.comp.mozilla.crypto
Message-ID <CAOZbdaHaD2u3CQhE3LDsrEwEhFC1865zQ8WpEdo6Ga1cprY_-A@mail.gmail.com>
Hi everyone.

I am using NSS in Ubuntu 16.04 with Java 7. I installed several modules in
FireFox, but modutil shipped with NSS only lists me NSS internal one . I
add my external Izenpe modules in secmod.db by

modutil -add "Module Name" -libdir "/some/quoted/dir" -dbdir
"/correct/db_dir/"

and now I can see them when I do

modutil -list

But they are still not accessible in my Java code.

With these lines I load the config file for my provider:

    String config = "library=/usr/lib/i386-linux-gnu/nss/libsoftokn3.so\n"
+ "name=NSSCrypto-Firma\n"
+ "attributes=compatibility\n"
+ "slot=2\n"
+ "showInfo=true\n"
+ "allowSingleThreadedModules=true\n"
+ "nssArgs=\"configdir='" + NSS_JSS_Utils.getFireFoxProfilePath() + "'
certPrefix='' keyPrefix='' secmod='secmod.db' + flags='readOnly'\" "
+ "\n"
+ "library=/usr/lib/libbit4ipki.so\n"
+ "name=\"Izenpe PKCS#11\"\n";
    Provider provider = new SunPKCS11(new
ByteArrayInputStream(config.getBytes()));

But it complains about "name" is appearing in two places, so I guess I can
only configure one provider here? But I have tried leaving only one of them
and none is working. CryptoManager is initialized correctly with FireFox
profile directory(/home/UserName/.mozilla/firefox), and modules are listed,
but only one.

Any help is appreciated, and thanks in advance.
-- 
dev-tech-crypto mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-crypto
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.