Quickstart for OpenSSL (Provider)
This guide provides a short summary of how to set up OpenSSL with Primus HSM using an OpenSSL provider. This guide assumes that you are using Debian/Ubuntu. Please see the full installation guide for more details.
For a wizard-like experience, use the installation script instead of the manual install. The script guides you through the process of installing and configuring the Primus PKCS#11 Provider and (optionally) integrates OpenSSL via PKCS#11.
-
Install the Primus PKCS#11 Provider and fully configure it. Verify the installation:
ppin --test -
Install OpenSSL and its
pkcs11-provider:sudo apt install openssl pkcs11-provider -
Create a separate OpenSSL configuration to enable the OpenSSL
pkcs11-provider. For details, see the configuration section. Copy the following to/etc/ssl/primus.cnf.HOME = .openssl_conf = openssl_initconfig_diagnostics = 1[openssl_init]providers = provider_sect[provider_sect]default = default_sectbase = base_sectpkcs11 = pkcs11_section[base_sect]activate = 1[default_sect]activate = 1[pkcs11_section]module = /usr/lib/x86_64-linux-gnu/ossl-modules/pkcs11.sopkcs11-module-path = /usr/local/primus/lib/libprimusP11.sopkcs11-module-encode-provider-uri-to-pem = truepkcs11-module-load-behavior = earlypkcs11-module-quirks = no-deinit no-operation-stateactivate = 1 -
Edit the global
/etc/ssl/openssl.cnfto include theprimus.cnf. Append the following line at the end:.include /etc/ssl/primus.cnf -
Test that the provider is enabled:
openssl list -providersProviders:basename: OpenSSL Base Providerversion: 3.3.1status: activedefaultname: OpenSSL Default Providerversion: 3.3.1status: activepkcs11name: PKCS#11 Providerversion: 3.1.4status: activeAnd offers
@ pkcs11algorithms:openssl list -signature-algorithms{ 1.2.840.113549.1.1.1, 2.5.8.1.1, RSA, rsaEncryption } @ default{ 1.2.840.10040.4.1, 1.2.840.10040.4.3, 1.3.14.3.2.12, 1.3.14.3.2.13, 1.3.14.3.2.27, DSA, DSA-old, DSA-SHA, DSA-SHA1, DSA-SHA1-old, dsaEncryption, dsaEncryption-old, dsaWithSHA, dsaWithSHA1, dsaWithSHA1-old } @ default{ 1.3.101.112, ED25519 } @ default{ 1.3.101.113, ED448 } @ default{ 1.2.156.10197.1.301, SM2 } @ defaultECDSA @ defaultHMAC @ defaultSIPHASH @ defaultPOLY1305 @ defaultCMAC @ default{ 1.2.840.113549.1.1.1, 2.5.8.1.1, RSA, rsaEncryption } @ pkcs11{ 1.3.101.112, ED25519 } @ pkcs11{ 1.3.101.113, ED448 } @ pkcs11ECDSA @ pkcs11You can use the OpenSSL
storeutlcommand to show a public key stored on your partition:openssl storeutl "pkcs11:token=${PARTITION_NAME};type=public;object=${KEY_LABEL}"
Next Steps
- Read the full installation guide
- Read the tutorial to learn how to use the OpenSSL CLI