Accessing NSS PKCS#11 (Shared) Database with libp11 under Windows?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Accessing NSS PKCS#11 (Shared) Database with libp11 under Windows?

Matthias Ballreich

Hi there,


I want to access (read and write) the Mozilla NSS Database (PKCS#11 Module) with libp11 and OpenSSL.

This is my actual Code but it did not work under Windows. I always got “-1” as return value, which tells, error on loading.

So where is the problem? What do i wrong? Has anybody got it working under Windows?


#include <libp11.h>


int main(int argc, char **argv)


                int rc = 0;

                PKCS11_CTX *pkcs11_ctx;

                pkcs11_ctx = PKCS11_CTX_new();


                                                    "configdir='C:/Users/Username/AppData/Roaming/Mozilla/Firefox/Profiles/5wzkdcjx.default' certPrefix='' keyPrefix='' secmod='secmod.db'");

                rc = PKCS11_CTX_load(pkcs11_ctx, " C:/Program Files (x86)/Mozilla/Firefox/softokn3.dll ");

                printf("Desc: %s\n", pkcs11_ctx->description);

                if (rc)

                               printf("Error loading Module");



Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.
Opensc-devel mailing list
[hidden email]