当前位置:网站首页>创建自签名证书, 对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
博客:
边栏推荐
- Flutter | specifies the type of page return value
- Tutorial on the principle and application of database system (044) -- MySQL query (VI): using the limit option to realize paging query
- Tutorial on principles and applications of database system (041) -- MySQL query (III): setting query conditions
- Flutter | firstwhere error reporting
- 多源文件方式去访问全局变量的方式(extern用法)
- IDEA 热部署(热加载)
- Introduction to several scenarios involving programming operation of Excel in SAP implementation project
- Image processing: Generation 3 × Window of 3
- Classic example of C language - loan balance
- What is the function of the select... For UPDATE statement? Can you lock tables or rows?
猜你喜欢

AVX instruction set accelerated matrix multiplication

工作3年的测试员跳槽后工资是原来的2倍,秘诀原来是......

Classic example of C language - print the input two digits in reverse order

Network system experiment: solve the problem of Ping failure

Generic mechanism and enhanced for loop

Fpga:ov7725 camera displays images in rgb565 format through vga/hdmi

Treatment of particle boundary collision

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

Creo 9.0 mouse button operation for model observation

A good habit to develop when writing SQL
随机推荐
vim常用命令
采坑websocket总结
Testers who have been employed for 3 months are facing employment confirmation. Leaders: 1 year of work experience is packaged into 5 years, and the probation period is eliminated
MySQL client to server character set conversion
Classic example of C language - loan balance
IDEA 热部署(热加载)
Flutter | firstwhere error reporting
Starfish OS: create a new paradigm of the meta universe with reality as the link
[flyway introduction]
Prometheus+node exporter+grafana monitoring server system resources
Centernet target detection model and centerfusion fusion target detection model
Summary of polynomial commitment schemes
Printf function - conversion description
The high-quality digital collection of guochuang's "children's song line" is on sale, and you are invited to create a young martial arts Jianghu dream
Method of C language annotation
Dataframe.groupby learning materials
工作3年的测试员跳槽后工资是原来的2倍,秘诀原来是......
JS drag and drop element
测试小码农也有大目标,最新BAT大厂面试题大总结(持续更新中...)
Easy gene | target gene DNA methylation sequencing (target BS)