FAQ Hero
Code Signing Trust

What Are Code Signing Best Practices?

What are code signing best practices?

Protect private keys in certified hardware. Control and log who can sign. Sign inside a controlled build process. Timestamp every signature. Scan before you sign. Have a plan to revoke and re-sign if a key or release is compromised.

  1. Keep keys in certified hardware. This has been required for publicly trusted certificates since June 1, 2023, and it’s good practice for private keys, too.
  2. Never share keys. Use role-based access and multi-factor authentication. Separate key administrators from signers, and remove access promptly when people change roles. (Why private keys should not be shared)
  3. Separate test keys from release keys. Use different keys for development builds and production releases.
  4. Sign in the pipeline, not on workstations. Automated, policy-controlled signing removes ad hoc signing. Hash signing keeps files local.
  5. Scan before signing. Signing malware makes it look trustworthy. Scan builds and dependencies first. Comparing builds from independent build servers can reveal tampering in the build process.
  6. Timestamp every signature. This keeps signatures valid after the certificate expires, and it limits the impact of revocation.
  7. Log and review signing activity. Record who or what signed, with which key, when, and under which policy.
  8. Plan for renewals. Public certificates now last at most 460 days.
  9. Enforce current cryptographic standards. Block weak algorithms and key sizes. RSA keys for public code signing must be at least 3072 bits. Track post-quantum guidance.
  10. Have an incident plan. If a key is compromised or malware is signed, contact your CA immediately to revoke the certificate. Then re-sign affected releases with a new key. Depending on the revocation date the CA sets, signatures timestamped before the compromise can remain valid.

How DigiCert helps: Software Trust Manager supports the key and access controls on this list: HSM key storage, role-based access, approvals, and signing logs.

Related questions: How do you create a code signing policy? · Can we automate code signing?