windows 生成数字证书

 1、创建一个自我签署的X.509证书(.cer)和一个.pvk私钥文件,用到makecert工具,命令如下:

makecert -r -n "CN=DKSOFT" -b 02/26/2014 -e 02/26/2014 -sv MyKey.pvk MyKey.cer

 2、 按提示设置私钥密码(也可以不使用密码)即可在当前目录生成相关文件

 3、利用X.509证书(.cer)创建发行者证书 (.spc),用到cert2spc工具,命令如下:

cert2spc MyKey.cer MyKey.spc

4、从.pvk和.spc格式转换成.pfx格式,用到pvk2pfx(C:/Program Files/Microsoft Visual Studio 10/vc/bin/),命令如下:

pvk2pfx -pvk MyKey.pvk -spc MyKey.spc -pfx MyKey.pfx -pi Password -f

 

 

/*****************************windows 64位驱动签名******************************/

 

windows vister X64系统开始,windows开始采用强制数字签名模式,在进行驱动测试过程中,提示windows无法验证此文件的数字签名。

 

测试过程中可采用两种方式

1、启用windows测试模式

命令:

bcdedit -set testsigning off  //windows测试模式

bcdedit -set testsigning on  //开启windows测试模式

 

2、可尝试使用64Signer V1.2.exe 对要测试驱动进行自身加签名,需注意,仅对本机有效

 

3、如果有正式签名,可使用签名进行对等校验签名认证(注,下方方式为代码演示)

 

C:\Users\*********\Desktop\c>signtool sign /v /ac MS_xs_UTN.crt /t http://timest
amp.wosign.com/timestamp Klogfor64.sys

The following certificates have been found to be suitable for signing:
Issued to: DKSOFT
Issued by: DKSOFT
Expires: Fri Jan 01 00:00:00 2010
SHA1 hash: E85441E1370BE07E8C1DB88F54F00CD80F01EF07

Issued to: DriverDevelop.com Signtools Test cert
Issued by: DriverDevelop.com CA
Expires: Tue Aug 13 11:02:01 2019
SHA1 hash: CED95F63BEBEF2CCC4E8AB9B3EA0883F41101415

Issued to: 53fb4eef7f78fc40e47ce5b06f57c106
Issued by: Alipay.com Corporation Machine CA
Expires: Fri Oct 23 15:08:17 2015
SHA1 hash: 4A602620157D1C966D40ADD713AA2C3230E7670F

SignTool Error: Multiple certificates were found that meet all the given
criteria. Use the /a option to allow SignTool to choose the best
certificate automatically or use the /sha1 option with the hash of the
desired certificate.
The following certificates meet all given criteria:
Issued to: DKSOFT
Issued by: DKSOFT
Expires: Fri Jan 01 00:00:00 2010
SHA1 hash: E85441E1370BE07E8C1DB88F54F00CD80F01EF07

Issued to: DriverDevelop.com Signtools Test cert
Issued by: DriverDevelop.com CA
Expires: Tue Aug 13 11:02:01 2019
SHA1 hash: CED95F63BEBEF2CCC4E8AB9B3EA0883F41101415

Issued to: 53fb4eef7f78fc40e47ce5b06f57c106
Issued by: Alipay.com Corporation Machine CA
Expires: Fri Oct 23 15:08:17 2015
SHA1 hash: 4A602620157D1C966D40ADD713AA2C3230E7670F

 

转载于:https://www.cnblogs.com/Savin/p/3570282.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值