Skip to main content

Protect private keys

Code signing best practices: Generate and store private keys in a secure manner

DigiCert recommends developers take precautions when implementing their code-signing process and securing the private keys associated with their signing certificates.


Limit access to keys

Maintain access controls to and accounting of code signing keys and limit their distribution. This will help enforce strict accountability for key use.

Physically secure the key storage device in a locked container

  • Ensure key storage devices are not left on desks, in unlocked drawers, or where they can be easily taken or copied.

  • Keep the device storing the private key in a locked desk drawer, cabinet, or behind locked doors.

Use a strong password for the private key

Choose a strong password for the private key. We require having at least sixteen (16) characters that are randomly generated containing uppercase letters, lowercase letters, numbers, and symbols to transport private keys. Words in a dictionary, derivatives of user IDs, common character sequences (e.g., "123456"), proper names, geographical locations, common acronyms, slang, family member names, birthdays, etc. are not to be used.

Secure storage for the private key

Securely store a private key using a FIPS 140-2 Level 2 or Common Criteria EAL4+ certified cryptographic device. Export of the private key is not allowed by these cryptographic devices. Most of these devices include multifactor authentication.

Test Signing certificate vs Release Signing certificate

Microsoft recommends using a separate Test signing certificate to sign prerelease code. The Test signing certificate should only be trusted in the test environment. Test signing certificates can be self-signed certificates or come from an internal test CA.

Additional information

For more information, Microsoft provides a best practices document on code-signing.