How to Digitally Sign Microsoft Files (.exe, .cab, .dll, .ocx, .msi, .xpi)

本文讨论了如何在Windows系统中为可执行文件和DLL进行数字签名,以解决未签名文件导致的未知发布者警告问题,并提供了从Verisign或Thawte购买证书的步骤以及使用数字签名工具的详细指南。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Sometimes Unix system administrators may end-up managing few Windows servers. If that ever happens to you, be prepared to do some basic administrative tasks on Windows. In this article, let us discuss how to sign microsoft executables and DLL.

Why digitally sign executable and other windows files?

You will get the following ‘Unknown Publisher’ message when a file is not digitally signed.

Fig: Unknown Publisher Message (If not digitally signed)

If you select the file -> right-mouse click -> properties -> There will not be a ‘Digital Signature’ tab for those files that are not signed.

Fig: Digital Signatures Tab (For valid signed files)

Purchase Microsoft Authenticode Certificates

You can purchase Microsoft authenticode certificate from either verisign or thawte.

During the purchase process, you’ll provide the following information:

  • Certification Information: Company name, Department, City, State, Country
  • Cryptographic service provider: Use the default Microsoft Enhanced Cryptographic Provider v1.0
  • Location to save the private key: During the certificate purchase process, you will be given an option to save the private key that was generated by the system.
  • Private key password

Sign Using the Digital Signature Tool Wizard

Call the digital signature tool signtool.exe that is located in your Microsoft SDK toolkit as shown below.

C:>"E:\Microsoft Platform SDK\Bin\signtool.exe" signwizard

Fig: Select the file that needs to be digitally signed

Choose ‘custom’ in the digital signing options, as shown below.

Fig: Digital signing option

Choose ‘Select from File’ option from this screen, and select the digital certificate that you have purchased.

Fig: Select the digital certificate

Choose ‘Private key file on disk’ option and select the private key that was given to you when you purchased the digital certificate.

Fig: Choose the private key

Fig: Enter private key password

Choose ‘sha1′ as the hasing algorithm

Fig: Select a hash algorithm

Leave all the fields to default value in this screen.

Fig: Additional certificate information

Leave the description and web location field empty.

Fig: Data Description

Add the following timestamp service URL:

http://timestamp.verisign.com/scripts/timstamp.dll

Fig: Add timestamp service url

This will successful sign the Microsoft executable with the digital signature. After the above steps, when you view the file properties, you’ll see the Digital-Signatures tab.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值