HSM'sHardware Security Modules's (HSM's) are used in systems where a company has determined that have either:the risk involved requires a higher level of control that a personal key.
- A FIPS compliance requirement higher than level 1 or,
- The company has determined that risk involved requires a higher level of control.
The Use of HSM's for Certificate Authorities
The suggestion for use in CA'sHSM's are common for CA applications, typically, when a corp run'scompany is running there own internal CA and needsthey need to protect the root CA Private Key, and when RAs need to generate, store, and handle asymmetric key pairs.
Other scenarios might beUses outside of a CA
HSM's are suggested for a companies Privileged Access Security System. These system's use the concept of a "vault" which is unlocked via a key or multiple keys. These keys are usually only required on startup of the vault.
YourWith vaulting systems, typically options for storage are to:
- Store them on the server. This is not very secure even when you limit access to the server.
- Store them on Disk/USB. This requires that disk be mounted every time the system is restarted (trouble if you do regular restarts).
- Store them on a HSM.
In secure systems, this allows key to be generated without a human needing access to it, stored in a system that is FIPS Level 2+ compliant, and only accessed when a system starts.
In generalUsing an USB Key vs a HSM
Primarily, HSM'send user USB's are not andesigned for the end-user productusers access. They are storing keys which might authenticate them, nor a common IT producthave encryption keys for data they are responsible for, or are part of a process that identifies the user is who they say they are.
Examples of this are the use of a YubiKey to hold the private encryption key managementfor sensitive company data. TheyYou might have access to a trade secret, or are allowed to perform analysis on compliance critical data such as PII and Healthcare or Credit Card Data.
HSM's are not designed to be a purpose built productpersonal authentication unit. They are installed on servers to meetprovide a higher levelsecure generation, storage, auditing, and distribution of compliancekeys for securehigh risk applications and systems.
Examples include the storage of server certificates for authentication between systems, encryption keys which are used by processes but don't need to be seen by humans, and shared keys between servers used to access encrypted data or establish encrypted connections.
Pseudo-Summary
You could think of the use cases in terms of people verses systems.
If a company has a need to provide increased security of systems which a person uses require access to as part of there job, something like a YubiKey makes sense.
If a company has a need to provide increased security to systems where processes and the systems themselves need access but a user wouldn't normally be required to know, then a HSM is the better option.
Anecdote
Imagine walking around with they key to your companies entire certificate authority in your pocket that provides the authenticity for 1200 servers and that Key slipped out a hole in your pants. Now imagine the nightmare of having to re-issue a new CA certificate, all the new signing certificates, and all the server certificates.
edits:
At the suggestion of @MikeOunsworth, I updated and expanded this answer.