Custom cryptography and SAM deployment across HSM platforms
The question is not whether code can run in the HSM, but whether it stays certified.
Standard PKCS#11 and KMIP interfaces cover most HSM use. But some services need logic that must run inside the HSM's tamper-protected boundary: national or emerging algorithms, custom key derivation, protocol rules that must not be bypassed, multi-party approval policies - and, for qualified remote signing, the Signature Activation Module (SAM) that enforces the signer's sole control. HSM vendors offer very different ways to do this, with different isolation models, languages, licensing and, above all, consequences for certification. This whitepaper compares the custom code capabilities of seven HSM platforms from public documentation and sets out how a SAM can be deployed with each.
Request the whitepaperSAVIS Research. Based on public vendor documentation reviewed in November 2026.
- 7HSM platforms compared
- 3ways to deploy a SAM
- 4custom code models: firmware module, container, sandbox, secure application
- EN 419 241-2the standard every SAM must meet
Why it matters now
Running code inside an HSM is powerful and risky. It lets an organization add algorithms that the vendor does not ship, enforce business rules where an administrator cannot bypass them, and implement components such as a SAM inside the certified boundary. But custom code can also change the validated configuration: a module that was FIPS 140-3 or Common Criteria certified may no longer be operating in its certified form, and the burden of evaluation can shift to the organization that wrote the code.
For qualified remote signing under eIDAS, the stakes are highest. The SAM defined by EN 419 241-2 must work with a cryptographic module certified to EN 419 221-5, and the combination must be evaluated. Choosing an HSM therefore also means choosing how the SAM will be built, certified and maintained.
Two audiences. One plan.
The whitepaper is written for the two groups who have to get this right together.
For CTOs, product owners and QTSP leaders
Which platforms allow custom cryptography, with what certification consequences, and the realistic routes to a certified SAM.
For HSM developers and architects
Isolation models, languages, licensing, networking and evidence to request, platform by platform, plus SAM deployment patterns.
What you will learn
- Why organizations need custom cryptography inside the HSM boundary.
- Four custom code models: firmware modules, containers, sandboxed runtimes and secure applications.
- How seven HSM platforms implement custom code, from public documentation.
- What each model means for FIPS 140-3 and Common Criteria certification.
- Three ways to deploy a SAM: inside the HSM, as a certified appliance or software beside the HSM, or built on the HSM's custom code platform.
- An evaluation table and the evidence to request before committing.
A look inside
Diagrams from the whitepaper.
SAVIS products in this whitepaper
SAM Appliance
Secure access module appliance that protects keys and signing operations.
View SAM Appliance →TrustCA Remote Signing
Sign from any device while keys stay inside the HSM.
View TrustCA Remote Signing →GP HSM
General-purpose hardware security module for key generation, signing and encryption in PKI, databases and applications.
View GP HSM →Crypto Agility
Discover and inventory every algorithm, key and certificate, then switch them by policy without rewriting applications - the foundation for post-quantum migration.
View Crypto Agility →Inside the whitepaper
- 1. Why custom cryptography in the HSM
- 2. Platform by platform
- 3. Deploying a SAM
- 4. Evaluation table
The questions to answer before writing code for an HSM
These four questions decide whether custom cryptography is an asset or a certification liability.
Boundary
Does custom code run inside the certified boundary, beside it in a separate protected environment, or in firmware that replaces part of it?
Certification
Does loading the code keep the module in its FIPS and Common Criteria certified configuration, according to the vendor's documentation?
Lifecycle
Who signs, approves, loads and updates the code, and how are developer identities controlled?
SAM
Is there an existing EN 419 241-2 certified SAM for this HSM, or must one be built and evaluated?
Three ways to deploy a SAM
Inside the HSM: the SAM runs within the HSM's certified boundary, built with the vendor's SDK or provided as a certified module - the strongest binding between activation and key use, but tied to one HSM platform and its toolchain. Beside the HSM: a certified SAM appliance or software component authorizes key use in a networked EN 419 221-5 HSM - flexible and often faster to deploy, but the combination must be covered by the certification. On the HSM's custom code platform: the SAM is written for a container or sandbox inside the HSM - promising for portability of logic, but requires its own EN 419 241-2 evaluation unless a certified implementation already exists.
Questions for the board
A board that gets a documented answer to each question is governing the risk. From the whitepaper:
- Which of our services truly need code inside the HSM, rather than standard APIs?
- Do we have documented vendor confirmation that our custom code keeps the module certified?
- Do we use a certified SAM, or are we planning to build and certify our own?
Go deeper on the blog
After Black Friday: behavioral biometrics that spot a coached scam victim
In the busiest shopping weeks of the year, the most expensive fraud is a genuine customer sending money on a scammer's instructions. Behavioral signals can show that the person at the keyboard is being coached, even when every credential is correct.
Read the post →Zero Trust for digital ID wallets: verify the holder, the device and the issuer every time
A digital identity wallet concentrates a person's most valuable credentials on one phone. Zero Trust gives a simple rule for protecting it: never accept a presentation because of where it came from, and verify the holder, the device, the issuer and the relying party on every transaction.
Read the post →Wallet-based onboarding for banks: cutting KYC fraud while meeting AML rules
Digital identity wallets let customers share verified identity data instead of photographing documents. For banks, that can cut document fraud and drop-off at onboarding - if the wallet flow is built into customer due diligence, not bolted on beside it.
Read the post →