p11mod allows you to create PKCS#11 modules in Go, and is easier to use and more idiomatic to Go than pkcs11mod. You implement your PKCS#11 functions by providing a struct that implements the same API as p11.Module
from Miek Gieben's p11 package; p11mod takes care of exposing this as a C ABI library (using pkcs11mod under the hood).
Prerequisites:
- Ensure you have the Go tools installed.
- Build pkcs11mod (see parent directory).
- You can
import "github.com/namecoin/pkcs11mod/p11mod"
from your Go PKCS#11 module.
See the p11proxy
sibling directory for an example of how to use p11mod.
Set the environment variable P11MOD_TRACE=1
to enable debug tracing. The trace will be outputted to the log file.