What is Code Signing and Why is it Essential for Windows Software?

AiroServer's Blog

What is Code Signing and Why is it Essential for Windows Software?

In the world of software development, gaining user trust is the first and most critical challenge facing any programmer or software company. When a user attempts to install your software on Windows, nothing is more damaging than a red warning window or an “Unknown Publisher” message. This warning not only harms brand reputation but often causes users to abort the installation entirely. The solution to bypassing this security barrier and establishing identity in the digital world is Code Signing.

This article provides a deep dive into the concept of digital code signing, how it functions within the Windows ecosystem, and modern Cloud-based solutions (based on Certum standards) to pave the way for secure software distribution.

Understanding Code Signing and Digital Signatures

Code Signing is a process where an executable file or script is digitally signed to confirm the author’s identity to the operating system and the end-user. This mechanism acts exactly like a wax seal on a confidential letter in the old days; if the seal is broken, the recipient knows the contents have been tampered with.

In the digital realm, this is achieved using Public Key Infrastructure (PKI). The developer signs their code using a Private Key, and the end-user or operating system uses a corresponding Public Key to verify that the file is exactly what the publisher released and has not been altered during download. A digital certificate, issued by a trusted Certificate Authority (CA), links the real-world identity of the publisher to that public key.

how Code Signing works?

How the Code Signing Mechanism Works

Based on technical documentation from trusted authorities like Certum, the signing process involves precise technical steps to guarantee file integrity. When a developer decides to sign their software, cryptographic algorithms come into play.

First, a Hash (digital fingerprint) of the software file is generated. This hash is then encrypted using the developer’s private key. This encrypted bundle, along with the digital certificate and public key, is attached to the executable file.

When a user runs the file, the Windows operating system performs two critical checks:

  1. It decrypts the signed hash using the public key found in the certificate.

  2. It generates a new hash from the downloaded file.

If these two hashes match, it proves the file was not tampered with during transit. Additionally, Windows checks the Trust Chain of the certificate up to a Trusted Root.

Why Code Signing is Mandatory for Windows Environment

Microsoft has adopted strict policies for executing binaries in recent versions of Windows. Without a digital signature, your software is effectively treated as potential malware. The necessity of this technology can be summarized in several key points:

The most obvious reason is to prevent the “Unknown Publisher” warning. This alert tells the user that Windows cannot identify the origin of the program, implying high risk. By signing the code, the company or developer’s name is displayed instead of “Unknown,” which has a direct positive impact on successful installation rates.

Secondly, it ensures code integrity. If malware attempts to inject malicious code into your executable, the digital signature becomes invalid, and the OS prevents the corrupted version from running. This is vital for software with auto-update features.

The Role of Windows SmartScreen

One of Windows’ most robust defense layers is Windows SmartScreen. This system operates based on file and publisher Reputation. Files lacking a digital signature are almost immediately blocked by SmartScreen, displaying an intimidating message that is difficult for average users to bypass.

Signing code with a valid certificate (especially EV certificates) signals to SmartScreen that the file belongs to a verified identity. Over time, as users download the file without reporting issues, the publisher’s Trust Score increases. SmartScreen builds no trust history for unsigned files, treating them as perpetual threats. Therefore, to bypass Microsoft’s security filters, Code Signing is not a choice—it is a technical requirement.

Which Files Require Code Signing?

Almost any file intended to execute code on Windows is a candidate for signing. However, the following formats are priority targets:

  • Executables (.exe): The most common format for applications.

  • Installers (.msi): Standard Windows installation packages.

  • Dynamic Link Libraries (.dll): Helper files called by executables.

  • Drivers (.sys): The most sensitive category. Windows 10 and 11 will not load kernel-mode drivers without a valid digital signature (often EV).

  • PowerShell Scripts (.ps1): Essential for network admin environments with restricted execution policies.

difference between Code Signing and ssl certificate

The Key Difference Between Code Signing and SSL

Many web administrators and developers are familiar with digital security concepts, yet the distinction between certificate types is often blurred. Both Code Signing and SSL utilize the same PKI infrastructure and asymmetric encryption, issued by CAs, but their purposes are fundamentally different.

An SSL certificate secures the communication channel between a user’s browser and a server to prevent eavesdropping. In contrast, Code Signing has nothing to do with network traffic; its job is to verify the identity and integrity of the software file itself (Data at Rest).

Although they are technically siblings, you cannot use an SSL certificate to sign an .exe file, and vice versa. SSL verifies a domain’s identity, while Code Signing verifies a software publisher’s identity. For a complete online business, both are necessary: one for the website and one for the application.

Cloud Code Signing and Modern Security

Traditionally, private keys were delivered to buyers on a physical cryptographic token (similar to a USB drive). This method had issues, such as the risk of losing the token or difficulties in distributed teams. Modern services have introduced the concept of Cloud Code Signing.

In this approach, the private key is never transferred to the developer’s local machine but is stored in a secure cloud environment. Developers use tools (like Certum’s SimplySign) or APIs to connect to the cloud service and send a signing request. The signing happens on the server, and the signed file is returned. This is ideal for teams using CI/CD (Continuous Integration/Continuous Deployment) systems, allowing for automated signing without the need for physical USB tokens.

Security Benefits of HSM-Based Signing

The security of the private key is the heart of the Code Signing process. If your private key is stolen, hackers can sign malware in your company’s name. Consequently, new security standards (such as CA/Browser Forum requirements) mandate the use of Hardware Security Modules (HSM).

In reputable cloud services, private keys are stored inside powerful HSM devices. These devices are designed to meet strict FIPS standards, making key extraction virtually impossible. The major advantage of HSM-based signing (whether cloud or physical token) is that even if a developer’s computer is compromised, the private key cannot be stolen because it never resides on the local disk or memory.

Standard vs. EV Code Signing Certificates

When obtaining Code Signing, developers typically face two main options: Standard (OV) and Extended Validation (EV). Understanding the difference is crucial for budget and security planning.

Feature Standard Certificate (OV) EV Certificate (Extended Validation)
SmartScreen Trust Reputation is built over time organically. Instant Reputation; SmartScreen warnings are removed immediately.
Key Storage Must be on a hardware token or HSM. Strictly on a physical hardware token or ultra-secure Cloud HSM.
Identity Verification Moderate check of company/domain. Rigorous vetting of the organization’s legal and physical existence.
Driver Signing Not suitable for Windows 10/11 Kernel mode. Mandatory for signing Kernel-mode drivers.
Cost More affordable. Higher cost due to complex vetting and hardware requirements.

If your software is intended for mass distribution and you want to avoid initial user friction, the EV version is the logical choice.

tools of Code Signing

Essential Tools for Signing Operations

To apply a digital signature, simply having the certificate file is not enough. You need command-line tools to perform the cryptographic operations. The two industry-standard tools are:

  • SignTool: The official Microsoft tool included in the Windows SDK, used for signing Windows files (.exe, .dll, .msi).

  • Jarsigner: The Java platform tool included with the JDK, used for signing Java archives (.jar) and Android applications.

Practical Guide: Using SignTool

SignTool is the most powerful utility for Windows developers. To use it, you must first connect your hardware token (or authorize the cloud service). A standard command to sign a file using SHA-256 and a timestamp server looks like this:

signtool sign /n "Your Company Name" /tr http://time.certum.pl /td sha256 /fd sha256 c:\path\to\your-app.exe

Key Parameters:

  • sign: Initiates the signing operation.

  • /n: The exact Subject Name listed in the certificate.

  • /tr: The Timestamp Server address.

  • /td: The digest algorithm for the timestamp (usually sha256).

  • /fd: The file digest algorithm. Modern Windows standards require SHA-256.

Practical Guide: Using Jarsigner

For Java developers, Jarsigner is the go-to tool. Unlike SignTool, Java uses a “KeyStore” concept. If your key is on a hardware token, you must configure Jarsigner to use the token as the KeyStore via a config file.

Sample command for signing a .jar file:

jarsigner -keystore NONE -storetype PKCS11 -tsa http://time.certum.pl -providerClass sun.security.pkcs11.SunPKCS11 -providerArg config.cfg your-app.jar "key-alias"

Here, -tsa specifies the Time Stamping Authority.

The Critical Role of Timestamping

Perhaps the most important auxiliary component in Code Signing is Timestamping. Digital certificates have expiration dates (e.g., one to three years).

What happens when the certificate expires?

  • Without Timestamp: As soon as the certificate expires, all software you previously signed becomes invalid, and Windows treats it as untrusted.

  • With Timestamp: The timestamp server verifies the exact date and time of signing from a trusted global source. This proves to the OS that “this file was signed while the certificate was still valid.” Consequently, the signed software remains valid and trusted indefinitely, even years after the certificate itself has expired.

Always use timestamp switches (/tr or -tsa) during every signing operation.

Verifying the Signature

After signing, never release the file immediately. You must verify the signature’s validity.

Visual Check:

Right-click the file, select Properties, and look for the Digital Signatures tab. Clicking on the signer’s name and selecting Details should display the message: “This digital signature is OK.”

Command Line Check:

For a deeper verification of the trust chain and hash algorithm:

signtool verify /pa /v c:\path\to\your-app.exe

The /pa switch forces the use of default Windows authentication policies (PnP), which is excellent for real-world testing.

Best Practices for Secure Release Cycles

Security in Code Signing goes beyond just buying a certificate. Organizations must adhere to strict protocols:

  1. Access Control: Limit access to the token or cloud signing panel to senior technical leads or build servers only.

  2. Scan Before Signing: Never sign a file before a full antivirus scan. Signing malware by accident will cause the CA to revoke your certificate, destroying your brand reputation.

  3. Lifecycle Management: Track certificate expiration dates carefully to renew before they lapse, ensuring no disruption in your software release cycle.

Conclusion

As cyber threats evolve, operating system defenses become more stringent. Code Signing is no longer a luxury for software companies; it is the entry ticket to the Windows ecosystem and the foundation of user trust. By utilizing asymmetric encryption and PKI infrastructure, this technology guarantees both Publisher Authenticity and File Integrity.

For developers, choosing between Standard and EV certificates, adopting cloud solutions, and strictly protecting private keys are strategic decisions. Ignoring these aspects leads to security warnings and user drop-off. By correctly implementing Code Signing with valid Timestamping, you send a clear message to both users and operating systems: your software is secure, authentic, and trustworthy.

en_USEN