当前位置:网站首页>创建自签名证书, 对exe文件进行数字签名
创建自签名证书, 对exe文件进行数字签名
2022-07-24 00:53:00 【宇龍_】
只需要简单几步即可操作:
1、以管理员权限运行PowerShell
2、执行如下命令
New-SelfSignedCertificate -Type Custom -Subject "CN=姓名, O=公司名称, C=CN, L=上海, S=上海" -KeyUsage DigitalSignature -FriendlyName "MailTool" -CertStoreLocation "Cert:\CurrentUser\My" -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.3", "2.5.29.19={text}") -NotAfter (Get-Date).AddYears(10)
3、执行如下命令
$password = ConvertTo-SecureString -String 123456 -Force -AsPlainText
4、执行命令导出证书,得根据实际情况修改下路径等信息
Export-PfxCertificate -cert "Cert:\CurrentUser\My\1F1B377E08BE74E2D739F0FC638370A93DF0D946" -FilePath C:\Users\admin\Desktop\dump\签名\test.pfx -Password $password
我们观察下签名目录,下面已经生成了test.pfx文件

5、现在我们用证书对Test.exe进行签名:
管理员运行CMD命令行,并切换到签名目录,执行如下命令:
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64\signtool.exe" sign /f test.pfx /p 123456 /t http://timestamp.digicert.com /v "test.exe"这个signtool.exe是安装Windows开发包的时候就自带了的,我的是该路径,具体的找找,执行命令之后的结果是这样的:

我们查看下Test.exe的证书

好了,已经可以了。
参考文章:
微软官方文档:
New-SelfSignedCertificate (pki) | Microsoft Docs
SignTool.exe (Sign Tool) - .NET Framework | Microsoft Docs
博客:
边栏推荐
- Table custom table encapsulation
- Dark horse programmer - interface test - four day learning interface test - day 4 - postman reads external data files, reads data files, IHRM project practice, employee management module, adds employe
- Redis | very important Middleware
- SAP 实施项目中涉及到编程方式操作 Excel 的几种场景介绍
- NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library ‘*****‘
- Dataframe.groupby learning materials
- 通信模块整理(二)HC-05
- First knowledge of C language functions
- MariaDB database upgrade version
- Flutter | specifies the type of page return value
猜你喜欢

黑馬程序員-接口測試-四天學習接口測試-第四天-Postman讀取外部數據文件,讀取數據文件數據,iHRM項目實戰,員工管理模塊,添加員工,批量運行測試用例,生成測試報告,

freemarker

Customize an object

NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library ‘*****‘

Introduction to QT (2.1 the first procedure for the beginning of QT)

Generic mechanism and enhanced for loop

Analysis of the advantages of the LAAS scheme of elephant swap led to strong performance of ETOKEN

The salary of a tester who has worked for 3 years after job hopping is twice that of the original. The secret is

Flutter | specifies the type of page return value

There are various signs that apple is expected to support AV1
随机推荐
Introduction to several scenarios involving programming operation of Excel in SAP implementation project
How to improve data quality
Classic examples of C language switch case statement conversion date format
Interviewer: if the order is not paid within 30 minutes after it is generated, it will be automatically cancelled. How to realize it?
Starfish OS: create a new paradigm of the meta universe with reality as the link
Detectron2 installation based on Anaconda under win10
PostgreSQL snapshot optimization globalvis new system analysis (greatly enhanced performance)
C language: deep analysis of const keyword
Multi data source configuration of mongodb
黑馬程序員-接口測試-四天學習接口測試-第四天-Postman讀取外部數據文件,讀取數據文件數據,iHRM項目實戰,員工管理模塊,添加員工,批量運行測試用例,生成測試報告,
EFCore高级Saas系统下单DbContext如何支持不同数据库的迁移
Classic example of C language - convert the input two digits into English
通信模块整理(二)HC-05
Memory forensics nssctf otterctf 2018 (replay)
【LeetCode第 83 场双周赛】
网络系统实验:ping不通的问题解决
Method of C language annotation
The way to access global variables in multi-source file mode (extern usage)
Okaleido tiger NFT is about to log in to the binance NFT platform. Are you looking forward to it?
Solve the error: uncaught (in promise) navigationduplicated: avoided redundant navigation to current location:“