cryptosense / pkcs11

OCaml bindings for the PKCS#11 cryptographic API
BSD 2-Clause "Simplified" License
22 stars 6 forks source link

Add support for NSS to the PKCS#11 Driver #118

Closed leamingrad closed 4 years ago

leamingrad commented 4 years ago

(Marking this PR as WIP unitl #117 is merged)

This PR adds support for the Network Security Services (NSS) PKCS#11 implementation when using the pkcs11-driver package.

The key difference is in the call to C_Initialize, for which NSS requires a different parameter set than the PKCS#11 spec (documented here).

I have added a new initialize_nss function at the top level which can be used by consumers to trigger this new function.

I have tried to keep the implementation minimal, but would be open to changing the design. The main alternative I could think of would be for the existing initialize function to take an Nss_initialize_args.u option instead of unit, but I decided against that to make it even clearer when the arguments would be used.