Skip to main content
Generate two RSA key pairs inside the CryptoHub: one acts as the certificate authority, the other is the responder’s IKE authentication key. Neither private key exists on the Linux host at any point. Use distinct object IDs so the final tunnel test is not affected by older test objects.

Key requirements

Generate the CryptoHub-resident CA key

Shell
The command reports the generated public key, Public Key Object; RSA 3072 bits, with the label strongSwanCA.
If this step fails with CKR_TEMPLATE_INCONSISTENT, the endpoint role is missing CertManage:Add. The client-side error text does not name the missing permission. Review the permissions in Before you start and retry.
Confirm the CA key exists:
Shell
The output shows Private Key Object; RSA, label strongSwanCA, ID 01, and Usage: sign, signRecover.
If this returns no output at all — no error, just nothing — the role is missing CertManage:Export or CertManage:Export Private Key. The key was created successfully; the client cannot enumerate it. Grant both and retry.

Create the self-signed CA certificate

When using an HSM object ID with ipsec pki --self, include --type priv. Without this option, strongSwan may fail to locate the HSM-backed private key.
Shell
Substitute your own organization and common name in --dn. Verify the CA certificate:
Shell
The output reports the subject and issuer as the same DN, flags: CA CRLSign self-signed, and pubkey: RSA 3072 bits. The log lines confirming found key on PKCS#11 token 'futurex':0 show the signature was produced inside the CryptoHub.

Generate the CryptoHub-resident responder key

Shell
Confirm the responder key exists:
Shell
Both a private and a public key object appear with the label StrongSwan and ID 02.
Read the public key out of the HSM so the CA can certify it:
Shell
strongswan-pub.der exists and is several hundred bytes. Only the public key is read out; the private key remains in the CryptoHub.

Issue the responder certificate with the CryptoHub CA key

Shell
--cakeyid 01 tells pki to sign with the CA key inside the CryptoHub. Verify the issued certificate:
Shell
--print reports subject CN=StrongSwan, the CA DN as issuer, and pubkey: RSA 3072 bits. --verify reports certificate trusted, lifetimes valid after reaching the self-signed root.
If any command on this page fails, see Troubleshooting.