Next: , Previous: , Up: Internals  


7.2 Developing Scute

Scute is single-threaded. There is a global lock that is taken in all entry points of Scute, except for C_Initialize, C_Finalize, C_GetFunctionList, and stubs.

Here are a couple of hints on how to develop PKCS #11 modules for Mozilla:

libopensc2 ships with a pkcs11-spy library that can be loaded as a wrapper around the PKCS #11 library you want to use to log all functions invoked by Mozilla. Here is how to use it:

Set the PKCS11SPY_OUTPUT environment variable to a filename. pkcs11-spy appends its log messages at the end of this file. Set the PKCS11SPY environment variable to the filename of the PKCS #11 module you actually want to use. Start Mozilla within this environment.

There is a different, probably more powerful way to debug Mozilla PKCS #11 libraries. However, to be able to use it, you need to configure and compile the Mozilla NSS sources with --enable-debug. Instructions can be found at: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/nss_tech_notes

Here are a couple of links to more information about implementing a PKCS #11 module for Mozilla:

https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/PKCS11_Implement

Guidelines for implementors of PKCS #11 modules targeting Mozilla

http://www-archive.mozilla.org/projects/security/pki/pkcs11/

PKCS #11 Conformance Testing

https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS

The Mozilla NSS web page