<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p></p>
<p class="x_MsoNormal"><span lang="EN-US">Hi there,</span></p>
<p class="x_MsoNormal"><span lang="EN-US"> </span></p>
<p class="x_MsoNormal"><span lang="EN-US">how can i access the Mozilla NSS (shared) Database (cert8 or cert9d.db) / PKCS#11-Modules via OpenSSL?</span></p>
<p class="x_MsoNormal"><span lang="EN-US">I need read & write access to the NSS User Cert Database (softokn3) and to the Built-In Cert Database (nssckbi) under Windows.</span></p>
<p class="x_MsoNormal"><span lang="EN-US"> </span></p>
<p class="x_MsoNormal"><span lang="EN-US">I tried it with Libp11 this way:</span></p>
<p class="x_MsoNormal"><span lang="EN-US"> </span></p>
<p class="x_MsoNormal"><span style="font-size:10.0pt; color:black" lang="EN-US">int rc = 0;<br>
        PKCS11_CTX *pkcs11_ctx;<br>
        pkcs11_ctx = PKCS11_CTX_new();<br>
        PKCS11_CTX_init_args(pkcs11_ctx,<br>
                             "configdir=''C:/Users/Username/AppData/Roaming/Mozilla/Firefox/Profiles/5wzkdcjx.default' certPrefix='' keyPrefix='' secmod='secmod.db'");<br>
        rc = PKCS11_CTX_load(pkcs11_ctx, " C:/Program Files (x86)/Mozilla/Firefox/softokn3.dll ");<br>
        printf("Desc: %s\n", pkcs11_ctx->description);<br>
        if (rc)<br>
                printf("Error loading Module");<br>
<br>
</span><span lang="EN-US">But it return every time “-1” which tells me that the loading fails. So is this the right way? Or should I use another library? Or is my code not right?</span></p>
<p class="x_MsoNormal"><span lang="EN-US">And can I edit the Trust Settings with that or another library like with NSS directly? Because I can’t delete the built-in certs of nssckbi because this is read-only I can edit the Trust-Settings for that certificate.
 Can I do that with OpenSSL in combination with a library, too? Or should I better use NSS instead of OpenSSL?</span></p>
<p class="x_MsoNormal"><span lang="EN-US"> </span></p>
<p class="x_MsoNormal"><span lang="EN-US">Thanks.</span></p>
<br>
<p></p>
</div>
</body>
</html>