Step 1: Extract the package and install the library
1
Extract the zip file downloaded from CryptoHub. It contains the Futurex PKCS #11 library and the material the library needs to authenticate to the appliance:
libfxpkcs11.so— the Futurex PKCS #11 library.fxpkcs11.cfg— the configuration file for the library.PKCS11Manager— a program to test the connection to the CryptoHub and perform basic functions through the FXPKCS11 module, such as logging in and generating random data.configTest— a program to test the configuration and connection to the CryptoHub.client.p12— the full client PKI in encrypted PKCS #12 format, containing the CA chain, client certificate, and client private key.client-cert.pem— the client TLS certificate.ca-chain.pem— the CA certificate bundle.CryptoHub <serial>.cer— an auto-generated self-signed CA certificate used to issue client endpoint TLS certificates. The file name carries your appliance’s serial number.Futurex Test Root CA (ECC).cerorFuturex Test Root SSL CA.cer— the Futurex Test Root CA for embedded Futurex Test TLS certificates. Only one is included, depending on the algorithm configured for the connection pair.
2
Move the library and the test utilities to a system library path so charon can load them:
Shell
configTest and PKCS11Manager are not executable after the zip is extracted. Without the chmod +x, both report Permission denied when you run the validation steps later on this page.Step 2: Place the configuration and TLS files
The Futurex PKCS #11 module expectsfxpkcs11.cfg in the /etc directory by default. The configuration references client.p12 and the two CA certificates, so those files must resolve from wherever the module runs.
This guide keeps the configuration at /etc/fxpkcs11.cfg and the TLS material in /etc/fxpkcs11/:
Shell
Step 3: Rewrite the TLS paths to absolute paths
The configuration file ships with the TLS files named by relative path. Relative names resolve against the working directory of whatever process loads the module, not against the location offxpkcs11.cfg. Because charon’s working directory differs from your shell’s, the files must either sit in the directory the process runs from or be referenced by absolute path. This guide uses absolute paths.
Rewrite the three entries in /etc/fxpkcs11.cfg:
fxpkcs11.cfg
CryptoHub <serial>.cer file name, and use whichever Futurex Test Root certificate your zip contained.
Two separate
<PROD-TLS-CA> entries are correct. The module expects one entry per CA certificate, so both lines are required.FXPKCS11_CFG. If you do, the TLS files must still resolve, either by absolute path as above or by sitting in the working directory:
Shell
Step 4: Record the PKCS #11 PIN
The PKCS #11 PIN is the value of the<CRYPTO-OPR-PASS> parameter in fxpkcs11.cfg. Copy it now: you need it for the key-generation commands in Create the HSM-backed CA and responder keys and for the secrets section of swanctl.conf later.
Step 5: Configure the PKCS #12 password
The PKCS #12 password is the value of<PROD-TLS-KEY-PASS> in fxpkcs11.cfg. Futurex recommends copying this password, then replacing the value in fxpkcs11.cfg with env:PKCS11_P12.
Set PKCS11_P12 system-wide:
Shell
your-p12-password with the password you copied:
Shell
Step 6: Set the FXPKCS11 log path
The log path comes from theLOG-FILE setting in fxpkcs11.cfg. A relative value resolves against the working directory of the process that loaded the module, and charon’s working directory is not writable. Set an explicit absolute path:
fxpkcs11.cfg
Step 7: Validate with configTest
Shell
The connection test succeeds and the slot list includes the CryptoHub token.
LOG-FILE path from step 6, then verify:
- The
fxpkcs11.cfgpath (default/etc/fxpkcs11.cfg), orFXPKCS11_CFGif you overrode it. client.p12and the.cerfiles resolve from the paths written in the configuration.PKCS11_P12is set correctly, if you used it. Start a new shell and runecho "$PKCS11_P12". An empty value passes through silently.- The host can reach the CryptoHub address and port named in
fxpkcs11.cfg.
Step 8: Confirm the token, the version, and login
1
Confirm the token and the library version:
Shell
The
Library line reads FxPKCS11 (ver 6.1) or later, and Cryptoki version reads 3.0. The slot list shows a token whose flags include token initialized and PIN initialized. If the token is not initialized, initialize it in the CryptoHub before continuing.Read the version from this runtime output rather than from
info.txt, which is not reliable for this library family.2
Validate login and PKCS #11 operations:
Shell
The command completes without an authentication error. On a new endpoint the object list is empty, which is expected; you create the keys in a later step.
Reading the PIN with
read -rsp keeps it out of the page and out of your shell history. Every later command in this guide that needs the PIN uses the same idiom.3
Now that validation has passed, comment out the For PKCS #11 integrations, the PIN is always configured in the third-party application rather than in the FXPKCS11 configuration file. For strongSwan, that means the
<CRYPTO-OPR-PASS> line in fxpkcs11.cfg:fxpkcs11.cfg
pin value in the secrets section of swanctl.conf.
