Programming

Signing a Windows EXE file

25 September 2026 · 7 min read

Signing a Windows EXE file

Ensuring the integrity and authenticity of your software is paramount in today’s digital landscape. For Windows developers, digitally signing your EXE files is a crucial step in this process. Code signing not only verifies the publisher’s identity but also assures users that the software hasn’t been tampered with since its release. This builds trust with your users, enhances your reputation, and contributes to a safer software ecosystem. In this guide, we’ll delve into the intricacies of signing a Windows EXE file, covering everything from the fundamental concepts to practical implementation.

What is Code Signing?

Code signing is the process of digitally signing executable files and scripts to confirm the software author’s identity and guarantee that the code hasn’t been altered or corrupted after it was signed. Think of it as a digital seal of approval. When a user downloads a signed EXE, Windows can verify its authenticity, increasing user confidence and reducing security warnings.

This process uses a digital certificate, issued by a trusted Certificate Authority (CA), to sign the code. The CA verifies the publisher’s identity before issuing the certificate. This verification adds an extra layer of security, making it significantly harder for malicious actors to distribute malware disguised as legitimate software.

According to a recent study by Sectigo, signed software downloads are 20% higher than unsigned software, demonstrating user preference for verified applications.

Why Sign Your Windows EXE Files?

Signing your EXE files provides several key benefits. First, it establishes trust with users. Seeing a verified publisher name associated with the software reassures users that the software is legitimate and not malware. This can significantly improve download rates and user adoption.

Second, code signing prevents tampering. If the EXE file is modified after signing, the digital signature will be invalidated, alerting users to potential security risks. This protects users from unknowingly installing compromised software.

Finally, code signing improves the overall user experience. Signed EXEs are less likely to trigger security warnings, streamlining the installation process and reducing user frustration. This contributes to a more positive user experience and fosters trust in your brand.

How to Sign a Windows EXE File

The process of signing a Windows EXE file involves several steps. You’ll need a code signing certificate from a reputable Certificate Authority, such as Sectigo, DigiCert, or GlobalSign. Once you have your certificate, you can use the following steps:

  1. Obtain a Code Signing Certificate: Choose a reputable CA and purchase a certificate that meets your needs.
  2. Install the Certificate: Install the certificate on the machine where you will be signing the code.
  3. Use the Signing Tool: Common tools include signtool.exe (included with the Windows SDK) or other commercial code signing software. You’ll need to specify the EXE file and your certificate.
  4. Verify the Signature: After signing, verify the signature to ensure it’s valid.

Here’s an example using signtool.exe: signtool sign /f MyCertificate.pfx /p MyPassword MyApplication.exe

Best Practices for Code Signing

To maximize the effectiveness of code signing, follow these best practices:

  • Protect Your Private Key: Store your private key securely to prevent unauthorized access.
  • Timestamp Your Signature: Timestamping ensures the signature remains valid even after the certificate expires.

By adhering to these best practices, you can ensure the long-term validity and effectiveness of your code signing efforts.

Regularly audit your signing process to ensure compliance with best practices and address any potential vulnerabilities.

Choosing the Right Code Signing Certificate

Selecting the right certificate depends on your specific needs. Different CAs offer various types of certificates, each with varying levels of validation. Learn more about choosing the right certificate. Consider factors like the type of software you are signing, your budget, and the level of assurance you want to provide to your users. Researching different CAs and comparing their offerings can help you make an informed decision.

For example, an Organization Validation (OV) certificate provides a higher level of assurance than a standard Domain Validation (DV) certificate. The higher the validation level, the more trust it instills in users.

Understanding the nuances of different certificate types is crucial for selecting the most appropriate certificate for your specific software and target audience.

Infographic Placeholder: Visual representation of the code signing process.

Frequently Asked Questions (FAQ)

Q: What is a Certificate Authority (CA)?

A: A Certificate Authority is a trusted entity that issues digital certificates. They act as a third party to verify the identity of individuals and organizations requesting certificates.

Protecting your software’s integrity and building user trust is essential for success in the software industry. Code signing offers a robust solution to address both these crucial aspects. By following the outlined steps and best practices, you can effectively sign your Windows EXE files, demonstrating your commitment to security and enhancing user confidence. Begin protecting your software and your users today by implementing a robust code signing process. Explore further resources on code signing and software security from reputable sources like Microsoft (link), DigiCert (link), and Sectigo (link). Investing in code signing is an investment in the future of your software.

Question & Answer :
I have an EXE file that I should like to sign so that Windows will not warn the end user about an application from an “unknown publisher”. I am not a Windows developer. The application in question is a screensaver generated from an application that generates screensaver applications. As such I have no influence on how the file is generated.

I’ve already found out that I will need a code signing certificate from a CA like Verisign or instantssl.com. What I don’t understand is what I need to do (if at all possible) to sign my EXE file. What is a simple explanation?

Mel Green’s answer took me further, but signtool wants me to specify what certificate to use in any case. Can I get a free code signing certificate somehow to test if this will work for me at all?

Also please specify which certificate kind is the correct one. Most sites only mention “code signing” and talk about signing applications that are actually compiled by the user. This is not the case for me.

How to sign your app

Use Microsoft’s SignTool to sign your app.

You download it as part of the Windows SDK. Note that it’s also possible to install SignTool without installing the entire SDK. Once installed you can use SignTool from the command line like so:

signtool sign /a /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 MyFile.exe 

This will sign MyFile.exe. Explanation of the used command line options:

  • /a will automatically use the certificate that is valid for the longest time. If you have no certificate, SignTool will display an error.
  • /fd SHA256 will use the SHA-256 digest algorithm for the file signature. Using SHA256 is recommended and considered to be more secure than the default SHA1 digest algorithm.
  • /tr http://timestamp.digicert.com adds a timestamp to your signed apps. This is extremely important because this will allow the signature to remain valid even after the certificate itself has already expired. The argument for the /tr option is a timestamp URL. You can use any of the timestamp URL’s from this list of free RFC 3161 timestamp servers.
  • /td SHA256 will use the SHA-256 digest algorithm for the timestamp signature. As before, using SHA256 is recommended and considered to be more secure.

How and when to use self-signed certificates

If you’d like to get a hold of a certificate that you can use to test your process of signing the executable, you can use MakeCert to create a self-signed certificate.

Once you’ve created your own certificate and have used it to sign your executable, you’ll need to manually add it as a Trusted Root CA for your machine in order for UAC to accept your self-signed certificate as a trusted source. Note that you can only do this on your own development machines. You usually can not do this on your user’s computers, since most users will not accept to install a new Root CA for good reasons.

How to get rid of the “unrecognized app” warning

Even if your app is signed, you might still see the following warning message when trying to run the app:

Microsoft Defender SmartScreen prevented an unrecognized app from starting. Running this app might put your PC at risk.

How to avoid this warning is a somewhat complex topic. Please see this answer to get the whole picture about these Microsoft SmartScreen warnings and what you can do and should know about it.