Skip to main content

Building Your Own Applications

You can build your own applications that call the PKCS#11 API. This is easiest to do from C and C++. You simply include the pkcs11.h header file and link your program against libprimusP11.so.

For a detailed tutorial, see the C code samples. More code samples are available on GitHub.

Calling the PKCS#11 API is also possible from other languages. However, this requires you to create foreign function interface (FFI) bindings to bridge your language to C. There may already exist bindings for your language, for example Python. However, these bindings are typically only for the standard PKCS#11 API, and do not include Securosys-specific extensions (such as attestation).

Header File

Include the $PRIMUS_HOME/include/pkcs11.h header file that ships with the Primus PKCS#11 Provider. It includes the standard PKCS#11 header file and adds Securosys-specific extensions for the Primus HSM.

Linking

Link your application against $PRIMUS_HOME/lib/libprimusP11.so (on Windows: $PRIMUS_HOME/primusP11.lib). Alternatively, you can dynamically load the library at runtime.

To validate that the required dependencies are installed, run: ldd $PRIMUS_HOME/lib/libprimusP11.so

Get started withCloudHSM for free.
Other questions?Ask Sales.
Feedback
Need help?