← Back to section · Digital Security
Protecting Signature Keys: Generation, Custody, Rotation, and Destruction
A signature's credibility ultimately rests on how its private key is kept. This article walks the full key lifecycle for signature-key protection and flags the new considerations post-quantum keys bring in size, randomness, and implementation.
However strong a signature algorithm is, it loses to a copied private key. The most damaging signature security incidents in history — CA private-key compromises, stolen code-signing keys used to sign malware — were almost never algorithm breaks; they were custody failures. The post-quantum migration, which changes algorithms anyway, is also a chance to overhaul key protection as a whole. This article follows the lifecycle in order: generation, storage, use, backup, rotation, and destruction.
Generation: Entropy and Ceremony
A key’s quality is decided at the moment of generation. Signature keys should be generated in a controlled environment by a compliant random number generator: entropy sources health-tested, the generation process auditable. For the highest-value keys — root CAs, national signing roots — industry practice is the key ceremony: in an isolated room, with multiple witnesses and auditors present and cameras recording, the key is generated step by step according to a script published in advance, backups are split and sealed, and the whole process leaves a verifiable chain of evidence.
Post-quantum algorithms add two reminders at generation time. First, ML-KEM and ML-DSA key generation consumes considerably more randomness than RSA and in a different structure, so the generating device’s random throughput and entropy-pool health need reassessment. Second, deterministic signing (ML-DSA’s default mode) moves randomness risk from “every signature” to “once at generation” — but that does not make fault injection and side channels at signing time irrelevant; check carefully whether the HSM’s implementation certification actually covers the new algorithms.
Storage and Use: Non-Exportable and Least Privilege
The golden rule of storage is the private key never leaves the hardware in plaintext. HSMs, smart cards, and qualified signature creation devices (QSCDs) certified to FIPS 140-3 or Common Criteria lock the key inside a tamper-resistant boundary and expose only a “data in, signature out” interface. Software key stores (files, PKCS#12 bundles) are acceptable only for low-value keys that can be revoked and reissued quickly, and even then only with strong passphrases and access control — with the clear-eyed recognition that any process able to read the key file effectively holds the key.
Controls at the point of use matter just as much: signing operations should require explicit authorization (in high-value settings, M-of-N split control so no single person can sign alone); signing services should rate-limit calls and log content; anomalous signing volumes — a code-signing key suddenly signing heavily outside release windows — should raise real-time alerts. Turning “signing” into a ticket-approved service rather than a command casually invoked from a build script is a lesson many organizations only add after being burned.
Backup, Rotation, and Destruction
Backup and “non-copyable” are in natural tension; the resolution is to keep backups under hardware protection too: keys migrate between HSMs in wrapped (encrypted) form, backup shares are held by different custodians (secret sharing), and restoration follows the same ceremony-grade procedure. Plain file backups are, in principle, not applicable to signature private keys.
Rotation should be planned, not incident-driven: signature keys should have explicit lifetimes and signature-count ceilings; before expiry, generate the successor, dual-sign through the transition, and move the old key into a “verify-only, never sign” state. Stateful hash-based signatures (LMS/XMSS) deserve a special callout: their private keys include the consumption state of one-time keys, and a backup restore that rolls state backwards — letting one state sign two different messages — severely weakens security. For such keys the backup doctrine is “rather retire the key and rebuild the trust root than restore old state,” and it must be written into the operations manual at selection time.
Destruction closes the lifecycle: retired keys should be zeroized inside the HSM under witness, backup shares destroyed in sync, and everything archived. Many compliance frameworks require proof that “after a given date, a certain key could not possibly sign anything anymore” — crucial for drawing liability boundaries in later disputes.
Incident Response: Plan for the Worst Day
The completeness of key protection should be tested under the assumption “it has already leaked.” Every high-value signature key should have a pre-written response plan: how a compromise is detected (signing-log anomalies, unauthorized signed samples in the wild, internal reporting channels); how the bleeding is stopped (certificate revocation, removing the root from trust stores, notifying verifiers out of band); and how service is restored (activating a ceremony-generated standby key, rebuilding the signing chain). Time targets for these three actions should be quantified and drilled regularly — the CA industry imposes strict response-time requirements for root-key compromise precisely because real cases exist where delayed handling after a CA key compromise led root programs to remove the entire trust chain.
The post-quantum context adds a new drill to the plan: emergency algorithm switch. If a signature algorithm in use is one day announced to be practically broken — classical or post-quantum alike — the institution must be able to move signing to a backup algorithm without replacing all infrastructure. That requires signing services to be algorithm-configurable from day one and verifiers to accept multiple algorithms side by side: algorithm agility built as an incident capability, not a one-off migration requirement. The plan should also state how dual-signed output during a switch is handled, whether legacy signatures need rescue timestamping (mind the time-window discipline of evidence renewal), and who approves external communications. Having this written down and drilled once does more to bound the damage on the day than any single technical measure.
A Minimum Inventory for the Migration
Finally, a minimum inventory checklist for the migration period: a full register of signature keys (purpose, algorithm, length, custody location, owner); each key’s exportability and backup form; authorization methods and log completeness at every signing call site; HSM support status and capacity for the new algorithms (post-quantum keys and signatures are larger — measure the storage and throughput of older devices); and the state-management plan for any stateful signature keys. The inventory routinely turns up problems more urgent than algorithm aging — such as a production signing key that has sat as a file on a build server for years. Fix those first, then change algorithms; do not reverse the order.
Tags: Key ProtectionHSMKey CeremonyKey Management