HSM key management
How hardware security modules protect your most important keys, how cloud KMS and Azure Key Vault HSM compare, and what post-quantum means for them.
A hardware security module (HSM) is tamper-resistant hardware that generates, stores and uses cryptographic keys so that the keys never leave it in plain form. HSM key management is the practice of running those keys through their whole life: creation, use, rotation, backup and destruction.
Why use an HSM for key management?
Software can be copied; an HSM key cannot be extracted. That makes HSMs the standard place to hold root and issuing certificate authority keys, code-signing keys, payment and PIN keys, database master keys and the key-encryption keys that wrap everything else. Most regulations and frameworks, including PCI DSS, expect high-value keys to sit in hardware validated to FIPS 140-2 or FIPS 140-3. An HSM key is also auditable: every use can be logged and tied to an authorized identity.
KMS vs HSM
A key management service (KMS) is the software layer that applications call to create and use keys, apply policy, rotate keys and log access. An HSM is the hardware that protects the keys underneath. In the cloud the two are usually combined: AWS KMS, Google Cloud KMS and Azure Key Vault all keep keys in HSMs behind a managed API. Choose a dedicated or single-tenant HSM when you need exclusive control of the hardware, specific interfaces such as PKCS#11, or a particular compliance level; choose a managed KMS when you want scale, simple integration and less to operate.
Azure Key Vault HSM options
Microsoft offers several ways to use HSMs in Azure:
- Azure Key Vault Premium stores HSM-protected keys in multi-tenant Key Vault, with the same API as standard keys.
- Azure Key Vault Managed HSM is a fully managed, single-tenant HSM pool validated to FIPS 140-3 Level 3. You control the security domain, and Microsoft cannot access your keys. It is the usual choice for customer-managed keys in regulated workloads.
- Azure Cloud HSM provides single-tenant HSMs for workloads that need direct access through standard interfaces such as PKCS#11, for example lifting an existing PKI or payment application into Azure.
Whichever you choose, the design questions are the same: who holds the security domain or quorum, how keys are backed up and recovered across regions, how access is granted through Microsoft Entra ID and role-based access control, and how key use is logged and monitored.
Cryptographic key management beyond the HSM
Cryptographic key management covers every key an organization uses, not only those in HSMs: TLS private keys on servers, SSH keys, API keys and tokens in secrets managers, database and disk encryption keys, and keys embedded in applications. A sound program gives each key an owner, a purpose, a lifetime and a storage location matched to its value, and records all of them in one place so nothing is forgotten when algorithms change.
HSM key management best practices
- Separate duties so no single administrator can create, use and export a key.
- Define key lifetimes and rotate keys on schedule and after any suspected exposure.
- Use envelope encryption: a few HSM-held keys wrap many data keys.
- Test backup and disaster recovery, including restoring a security domain.
- Send key-use logs to your SIEM and alert on unusual activity.
- Record every HSM key in your cryptographic inventory with an owner and purpose.
Getting HSMs ready for post-quantum cryptography
HSMs are often the slowest part of a post-quantum migration, because new algorithms need new firmware, new validations and sometimes new hardware. Certificate authorities cannot issue ML-DSA certificates until their HSMs can generate and use ML-DSA keys. Ask your HSM and cloud KMS vendors for their roadmaps for ML-KEM, ML-DSA and SLH-DSA and for FIPS 140-3 validation, and plan hardware refreshes around them. See our guide to the NIST PQC standards for the algorithms involved.
Talk to a post-quantum cryptography consultant
YugamGroup is a Chicago-based post-quantum cryptography consultancy serving regulated enterprises across the US. We design and modernize HSM and key management on Azure, AWS and on-premises, and get it ready for post-quantum algorithms. Book a PQC readiness assessment or read more about our PQC and cloud security consulting services.
Related guides
- What is post-quantum cryptography?
- NIST PQC standards: ML-KEM, ML-DSA and SLH-DSA
- Harvest now, decrypt later
- Crypto agility and cryptographic inventory
- Agentic AI governance
- PQC migration guide
- What is Q-Day?
- Post-quantum PKI and quantum-safe certificates
- CNSA 2.0 requirements and timeline
- Quantum key distribution vs post-quantum cryptography
- Post-quantum cryptography glossary