What Is a Hardware Security Module (HSM)?
-
A hardware security module (HSM) is a device that creates and uses cryptographic keys without ever letting them out. Here's how an HSM works, how it differs from a USB token, and what it means for code signing.
- Automatic renewals
- Less manual work
-
-
*
What Is an HSM?
An HSM is a physical, tamper-resistant device built to generate, store, and use cryptographic keys. It performs operations such as digital signing, encryption, and decryption inside its own protected hardware, and it never hands the private key to the computer or application that asked for the operation.
This is the key difference from storing a key in a file. A key file can be copied, stolen by malware, or left in a backup. Even an encrypted key file has to be loaded into the computer's memory when it's used. With an HSM, the key stays inside the device the whole time.
-
*
How an HSM Works
Every time an application needs a key, the same four steps happen:
- Request. A signing tool or other application asks the HSM to use a specific key, for example to sign a file.
- Check. The HSM verifies that the requester is allowed to use that key for that operation.
- Process. If the request is allowed, the HSM performs the operation inside the device.
- Return. The HSM sends back the result, such as a digital signature. The private key itself is never returned.
Keys are usually created inside the HSM and marked as non-exportable, so there's no way to copy them out of the device.
-
*
USB Tokens, Network HSMs, and Cloud HSMs
Hardware key protection comes in several formats:
Format What it is Typical fit USB token A small hardware device that holds one or a few keys and is plugged into the computer used for signing. Individual developers and small teams that sign from one machine Network HSM A dedicated appliance that you install and run in your own data center, shared by many systems and users. Organizations with high signing volumes or strict internal security requirements Cloud HSM HSM hardware run by a cloud provider, which you access over the network. Teams that sign from build servers or CI/CD pipelines, or from several locations A USB token provides the same kind of hardware protection for a single signing key, but it isn't a full HSM. HSMs are built to serve many users and systems at once, with central administration, backups, and audit logs. Some certificate authorities also offer cloud signing services, where the key is kept in the CA's own cloud HSM and you don't need any hardware of your own.
-
*
HSMs and Code Signing
Since June 2023, the private key for every code signing certificate must be generated and stored in certified hardware: a USB token, an HSM, or a cloud HSM. The hardware must be certified to at least FIPS 140-2 Level 2, Common Criteria EAL 4+, or an equivalent standard. See Code Signing 2023 Industry Changes and What Is FIPS 140? .
For code signing, an HSM keeps the signing key away from build servers and developers' computers. Signing tools send the file's hash to the HSM, the HSM signs it, and only the signature comes back. It also gives you one place to control who can sign and to see a record of every signature.
Important: If you plan to use your own HSM, check that it's supported by your certificate authority before you order. GoGetSSL and DigiCert code signing certificates work with any cloud HSM certified to FIPS 140 Level 2, Common Criteria EAL 4+, or equivalent. Sectigo accepts only the following devices: Luna Network Attached HSM v7.x, Luna Cloud HSM, YubiKey 5 FIPS Series, Google Cloud KMS, and Fortanix.
Tip: Certification applies to a specific device model and firmware version, not to a brand as a whole. Ask the vendor for the certificate number and check it before you buy.
-