Hardware Security Modules (HSMs): Types, Cloud Services, and Use Cases
Learn how general-purpose, payment, network, PCIe, cloud, and KMS-backed HSMs differ, and where to use them for crypto custody, payments, encryption, PKI, and code signing.
By BoundLayer Engineering Team
BoundLayer is a senior engineering partner for SaaS, fintech, AI automation, cloud infrastructure, legacy modernization, Web3, IoT, GPU computing, and data systems.
Encryption is only as strong as the protection around its keys. A database may use strong encryption, but if the decryption key is stored beside the database or exposed to application processes, an attacker who compromises the host may be able to get both.
A hardware security module (HSM) is a tamper-resistant cryptographic device that protects keys and performs operations such as signing, encryption, decryption, and key generation. Applications request cryptographic operations through controlled interfaces rather than handling the protected private key directly. NIST describes HSMs as devices for safeguarding and managing cryptographic keys and providing cryptographic processing (NIST glossary).
HSM is not one product category with one deployment model. The term spans different form factors, service models, algorithms, certifications, and operational responsibilities. This guide explains the main types, how to choose between them, and where they are useful in cloud, fintech, and cryptocurrency systems.
HSM Types: Two Different Ways to Classify Them
HSMs are easiest to understand across two independent dimensions: how they are deployed and what cryptographic workload they are designed to support. A payment HSM may be a network appliance or a cloud-hosted single-tenant device; “payment” describes its purpose, while “network” or “cloud” describes how it is accessed.
By form factor and operating model
| Type | How it works | Common fit |
|---|---|---|
| PCIe or embedded HSM | A card or module installed in a server or appliance | High-throughput signing, certificate authorities, or an application with a local HSM integration |
| Network HSM appliance | A physical device reached over a secured network interface | Data centers, private infrastructure, and applications already designed for HSM clusters |
| Cloud dedicated HSM | A provider-hosted, usually single-tenant cluster exposed to a customer network | Workloads needing direct HSM administration, specialized APIs, or a customer-controlled security domain |
| Managed KMS backed by HSMs | A cloud key-management API backed by provider-operated HSM infrastructure | Encryption keys and signing where managed lifecycle, policy integration, and lower operational burden matter most |
| Multi-tenant cloud HSM | HSM infrastructure shared between customers with logical and cryptographic isolation | Provider services designed to offer HSM-backed operations at managed scale; confirm the exact isolation and certification model |
These options move responsibility between the customer and provider. With a managed KMS, the provider operates the HSM fleet and customers control keys through service policies and APIs. With a dedicated cluster, the team usually takes on more administration: HSM users, client software, backups, availability design, monitoring, and recovery procedures.
By cryptographic purpose
General-purpose HSMs protect keys for a broad range of applications, including public-key infrastructure (PKI), TLS, code and document signing, database encryption, and application-level cryptography.
Payment HSMs implement specialized payment functions such as PIN processing, payment-key management, and card-related cryptographic operations. PCI SSC's PTS HSM standard addresses the design and evaluation of HSM devices for payment environments. A PTS HSM listing is an approval of a device against that product standard; it is not proof that a company, payment application, or cardholder data environment is PCI DSS compliant.
An HSM's form factor does not establish its capabilities or approvals. Before procurement, verify the exact model, firmware, supported algorithms, approved configuration, and listing status relevant to the workload.
HSM, KMS, Secrets Manager, TPM, and MPC Are Not Synonyms
These technologies address related but different problems:
- HSM: protects cryptographic key material and performs cryptographic operations within a hardware security boundary.
- KMS: manages key policies, lifecycle, audit, and access through a service API. A KMS may use HSMs underneath, but customers may not administer or directly access those HSMs.
- Secrets manager: stores and distributes application secrets such as API credentials and database passwords. It is not automatically an HSM and should not be treated as a substitute for one.
- TPM or secure element: a hardware security component typically attached to an endpoint, server, or embedded device. It is useful for device identity and boot integrity, but has a different deployment and scale model from a network HSM service.
- MPC (multi-party computation): distributes cryptographic signing authority across participants or systems. It can provide custody controls without a single conventional HSM holding the complete signing key. It is a separate architecture, not a type of HSM.
Choosing a service because it says “hardware-backed” is not enough. Match the interface and trust model to the application: who can invoke keys, who can administer the key store, whether plaintext key material can ever be exported, and how recovery works.
Where HSMs Are Used
1. Cloud encryption and envelope encryption
Applications commonly encrypt records with data-encryption keys (DEKs), then protect those DEKs using a key-encryption key (KEK) managed by a KMS or HSM. This envelope-encryption pattern avoids sending every database record through a single central key while keeping control over the keys that unlock the data.
Use an HSM-backed KMS when the application needs standard encryption, key rotation, IAM policies, audit events, or cloud-service integrations. A dedicated HSM may be appropriate when you need direct HSM-level control, a specialized cryptographic interface, or a customer-controlled root of trust. AWS documents both its KMS model and CloudHSM-backed custom key stores.
2. Cryptocurrency custody and transaction signing
Crypto custody systems use cryptographic keys to authorize irreversible blockchain transactions. An HSM can generate or protect a signing key and perform signing without exposing the private key to application memory or operators.
That does not make signing safe by itself. A compromised service may still call an HSM API and request a valid signature. Put a policy-enforcing signing service between business workflows and the HSM. It should verify the asset, destination, amount, transaction context, authorization, and risk limits before invoking the key. Separate production and test keys; apply approval thresholds for high-risk transfers; and retain an audited recovery and key-rotation process.
Check chain-specific requirements before selecting a product. For example, a wallet may require secp256k1, a particular message-digest behavior, and a signature format that the chain accepts. The HSM API may return a mathematically valid signature that still needs careful encoding or transaction-specific handling. AWS KMS and Azure Managed HSM document support for the secp256k1 curve, but that alone does not prove an end-to-end wallet integration is compatible: verify the precise operation and wire format in a test environment (AWS supported algorithms, Azure Managed HSM key types).
HSM key custody also differs from MPC custody. Both can protect transaction authorization, but their failure modes, signer topology, recovery procedures, operational assumptions, and audit model are different. Choose based on the threat model rather than treating either as a compliance checkbox.
3. Card payments and PIN operations
Payment processors, issuers, and other payment service providers may use Payment HSMs for functions such as PIN translation, payment-key management, and transaction cryptography. These functions have specialized APIs and key ceremonies that are not interchangeable with a general-purpose KMS.
Using a Payment HSM does not by itself establish PCI DSS compliance. PCI DSS scope includes the cardholder data environment and systems that can affect its security; controls, people, processes, and service-provider responsibilities still need to be assessed. See our PCI DSS guide for crypto businesses for how card-payment flows intersect with cryptocurrency services.
4. Certificate authorities and TLS
An organization operating a certificate authority (CA) can use an HSM to protect the private key that signs certificates. HSM-backed signing can also support TLS termination, code signing, document signing, and workload identity systems. Protecting a CA key limits one important class of compromise, but certificate issuance policy, operator access, revocation, and recovery remain essential.
5. Software supply-chain signing
Release signing keys can be held behind KMS or HSM interfaces so build and release systems request signatures without receiving exportable private keys. This helps reduce key exposure, but build pipeline permissions are still security-critical: an attacker who can alter a release workflow or freely call the signing API may publish a malicious artifact with a legitimate signature.
Separate build, approval, and signing authorities. Require a trusted workload identity, limit which artifacts may be signed, log requests, and provide a revocation path. HSMs protect key material; they do not verify that the code being signed is trustworthy.
6. Database encryption and tokenization
Database products can use a key in an HSM or KMS to encrypt data-at-rest keys. HSM-backed tokenization systems can also protect keys used to transform sensitive values into tokens. Consider latency, throughput, and availability: online HSM calls in a critical request path need capacity planning, timeouts, retries, and graceful failure behavior.
AWS and Azure HSM Choices
Cloud product names can be confusing because providers expose both managed key APIs and more directly administered HSM clusters.
| Service | Model | Typical choice when |
|---|---|---|
| AWS KMS | Managed key service backed by HSMs | You need cloud-integrated encryption or supported signing through KMS APIs |
| AWS CloudHSM | Customer-managed HSM cluster | You need a dedicated cluster and direct HSM user/key control or a supported low-level interface |
| Azure Key Vault Managed HSM | Managed HSM service with customer control of key access and security domain | Azure services or applications need HSM-protected keys through the Managed HSM model |
| Azure Cloud HSM | Dedicated, single-tenant HSM cluster connected to a virtual network | Applications need direct HSM integrations such as PKCS#11 or OpenSSL |
| Azure Payment HSM | Payment-specific HSM service | You need payment operations such as PIN or EMV cryptography |
Product capabilities and certifications change. Azure states that its older Dedicated HSM service is being retired, with existing customers supported until July 31, 2028 and no new customer onboarding; new projects should compare current Cloud HSM and Managed HSM offerings instead. Always verify service availability, regional support, algorithm compatibility, and compliance evidence for the specific service and configuration.
How to Choose an HSM
Answer these questions before selecting a vendor or product:
- What are the keys for? Data encryption, wallet signing, certificate issuance, card PIN processing, and release signing have different requirements.
- Which algorithms and interfaces are required? Check curves, signature formats, APIs such as PKCS#11, supported key operations, and application-library compatibility.
- Who must control the HSM? Decide whether a managed KMS is sufficient or the team needs a dedicated HSM security domain and more direct administration.
- What validation applies? FIPS validation, PCI PTS HSM approval, PCI DSS assessment scope, and other certifications serve different purposes. Confirm the exact requirement with your assessor or compliance owner.
- How will it fail and recover? Plan for cluster redundancy, backups, key rotation, disaster recovery, account loss, region outages, and vendor exit before production keys are created.
- Can the service sustain the workload? Measure transaction throughput, latency, concurrency limits, quotas, cost, and operational support using realistic traffic.
- Who can request an operation? Restrict key use by workload identity and policy. Protect administrative operations with separation of duties, dual control where required, and tamper-evident audit logs.
What HSMs Do Not Solve
An HSM does not make a vulnerable application secure, prevent an authorized but malicious user from requesting a signature, validate business logic, secure a blockchain contract, or eliminate compliance obligations. If the application can ask the HSM to sign arbitrary data, a compromised application may abuse that capability without extracting the key.
The complete design includes key lifecycle procedures, access control, application-level authorization, monitoring, tested recovery, and evidence that the selected device or cloud service is configured as intended. For production crypto platforms, combine custody controls with the separate card-data boundaries described in our PCI DSS and cryptocurrency architecture article.
An HSM is most valuable when it fits a precise security requirement and the surrounding system limits who can use its cryptographic capabilities. Choose the deployment model and validated configuration for the workload, then test the entire key lifecycle—from creation and access to backup, recovery, rotation, and retirement—before depending on it in production.
Related engineering articles
PCI DSS for Crypto Businesses: Scope Card Payments and Protect the CDE
A practical PCI DSS guide for cryptocurrency exchanges, wallets, and fintech platforms: map card-payment flows, reduce CDE scope, manage providers, and separate PCI controls from crypto custody security.
Post-Quantum Cryptography Migration for SaaS: Inventory, Agility, and a Practical Roadmap
Plan a post-quantum cryptography migration for SaaS: discover crypto dependencies, prioritize long-lived data, build algorithm agility, and test protocol interoperability against NIST standards.
Workload Identity for Cloud-Native Systems: SPIFFE, SPIRE, mTLS, and Replacing Static Secrets
A practical guide to workload identity with SPIFFE, SPIRE, mTLS, attestation, trust domains, cloud federation, authorization, rotation, and migration from static secrets.
Choosing an HSM for a production system?
We help engineering teams match key-management requirements to cloud HSM services, payment controls, and application architecture.