HSM · Key custody · Thales Luna · PKCS#11 · Sovereignty
Signing tokens with keys that never leave the HSM: HelixIAM tested with Thales Luna Cloud HSM
Many European public bodies and banks keep their keys in HSMs. What High assurance key custody does in HelixIAM, how we tested it with a Thales Luna Cloud HSM, the signing times we measured and how the setup works.
- Realm keys
- ES256, RS256 and PS256, generated in the HSM
- Tokens
- Verified against the realm's JWKS
- Lifecycle
- Rotation, emergency rotation and restart passed
- Signing time
- About 25 ms at p50 and 45 ms at p95
On this page
Every token your identity provider signs is only as trustworthy as the private key behind it. Whoever holds that key can mint a valid sign-in for every application that trusts the provider. That is why many European public bodies and banks keep their keys in hardware security modules (HSMs), and why “where is the signing key?” is one of the first questions a security board asks about an identity platform.
This article explains what HSM key custody means for an identity provider, what the High assurance profile in HelixIAM does, and how we tested it with a Thales Luna Cloud HSM: what we ran, what we measured and what the setup looks like.
Why key custody matters to government and regulated buyers
An identity provider is a small piece of software with a very large blast radius. It decides who gets into the case-management system, the payment back office and the citizen portal. Its signing key is the root of that decision. If the key is copied, nobody can tell a forged token from a real one until the key is rotated, and every application that trusted it has to be reviewed.
Organisations that already run HSMs have usually settled three things:
- The key is generated inside hardware they control and cannot be exported.
- Use of the key is logged and limited by the HSM’s own policy, separate from the application.
- Operations follow an existing process: partitions, Crypto Officer roles, backups and key ceremonies that their security team already owns.
An identity provider that keeps its keys in its own database asks these organisations to make an exception. One that signs through their HSM fits the process they already have.
What High assurance does
HelixIAM lets you choose per realm where the private signing keys live, in three key-custody profiles:
| Profile | Where the private keys live |
|---|---|
| Standard | Generated by the server and stored encrypted in the database. |
| Protected | Stored in the database only in wrapped form, by a key-encryption key held in your HSM or Vault. |
| High assurance | Generated in your HSM or Vault and never leaving it. Signing is done by that backend. |
With High assurance, HelixIAM never holds the private key. When it issues an ID token or access token, it sends the data to be signed to the HSM over PKCS#11 and receives the signature back. The public half is published in the realm’s JWKS, so your applications verify tokens exactly as before. Nothing changes for them.
The profile is set per realm. A realm for a public-facing service can move to High assurance while a development realm stays on Standard. Each realm keeps its own signing keys with safe rotation, and you can give a tenant a dedicated HSM partition if you want the separation to hold in the key store as well.
Tested with Thales Luna Cloud HSM
We tested HelixIAM with a Thales Luna Cloud HSM service on Thales Data Protection on Demand , on a partition with FIPS restrictions on, using the standard Luna client and its PKCS#11 library. We ran it on Kubernetes with the Helm chart and with Docker Compose.
What we ran, with every realm on High assurance:
- Realm signing keys in the HSM for ES256, RS256 and PS256, generated in the partition and used there for every signature.
- Tokens checked against JWKS. Tokens issued by each realm were verified against that realm’s published JWKS, for every algorithm and for a second realm with its own keys.
- Rotation. Normal key rotation and emergency rotation both passed.
- Restart. After a restart the server reconnected to the HSM and the same key went on signing.
What we measured
A signature on the Luna Cloud HSM took about 25 ms at p50 and up to about 45 ms at p95, for both ES256 and RS256.
Treat these numbers as the shape of the cost, not as a production figure. They were measured over the public internet to a cloud HSM, and most of that time is the round trip to the HSM. The distance between your HelixIAM pods and your HSM will decide your own numbers. Every token signed in a High assurance realm pays this cost once, which is why the choice is per realm and why you size the number of HSM sessions to the concurrency you expect.
One thing to know before you start
EdDSA is not available in FIPS mode on a Luna partition. Use ES256, RS256 or PS256 for realms in High assurance on Luna; HelixIAM refuses EdDSA on that backend with an error.
The setup, in brief
The full guide is on the docs site: Thales Luna HSM in the HelixIAM documentation. In outline:
- In Data Protection on Demand, create a Luna Cloud HSM service and download its client package. Initialise the partition and its Crypto Officer with the Luna tools.
- Treat the client package as a secret. Its configuration holds the credentials for the service, so mount it from a Kubernetes Secret, not a ConfigMap. The Crypto Officer PIN goes in as a read-only Secret file, never as an environment variable.
- Allow egress on TCP 443 from the HelixIAM pods to the Data Protection on Demand endpoints for your region.
- Add a PKCS#11 key store to the HelixIAM configuration: the path to the Luna library, the partition label, the PIN file and timeouts suited to a network HSM.
- Check the key store is healthy through the admin API, then switch a realm to High assurance on that key store. HelixIAM generates the realm’s keys in the HSM, and from then on every signature for that realm happens there.
What stays with you
An HSM moves the key out of the application’s reach. It does not remove the work around it:
- Running the HSM. Partitions, Crypto Officer credentials, backups and access policy stay with your security team, as they do today.
- Choosing the profile. High assurance adds a call to the HSM for every signature. Use it for the realms that need it.
- Your own assurance. Whether a given HSM and partition meet your policy is your decision. HelixIAM uses the HSM; your process governs it.
How to start
- A technical demo. We show a realm moving from Standard to High assurance on a running system, with tokens verified against its JWKS.
- Your use case. We map your tenants, your HSM partitions and your key-custody policy to a realm layout.
- A paid pilot. If it fits, a pilot on your own infrastructure against your own HSM, with success criteria agreed up front.
HelixIAM is commercial software from KubeDNA B.V., available under a commercial licence. It is in early access, and we are now onboarding launch partners. If your security board’s first question is “where is the signing key?”, the answer can be: in your HSM, and it never leaves.