给ocx控件做数字签名

 最近做个ocx控件,需要做数字签名,看了许多文章,做了个脚本,运行成功。

 

@echo off

SET SIGNPATH=
SET PATH=%PATH%;D:/Program Files/Microsoft.NET/SDK/v1.1/Bin

SET ERROR=
if EXIST GSMPlayerControl.cer @del GSMPlayerControl.cer
if EXIST GSMPlayerControl.pvk @del GSMPlayerControl.pvk
makecert.exe -sv GSMPlayerControl.pvk -ss GMSPlayerControl -n "CN=sedtest,E=support@sedtest.com.cn,O=LGA" GSMPlayerControl.cer
IF NOT EXIST GSMPlayerControl.cer SET ERROR=%ERROR%GSMPlayerControl.cer is not exists
IF NOT "%ERROR%"=="" goto ERROR
echo GSMPlayerControl.cer is generated

if EXIST GSMPlayerControl.spc @del GSMPlayerControl.spc
Cert2Spc.exe GSMPlayerControl.cer GSMPlayerControl.spc
IF NOT EXIST GSMPlayerControl.spc SET ERROR=%ERROR%GSMPlayerControl.spc is not exits
IF NOT "%ERROR%"=="" goto ERROR
echo GSMPlayerControl.spc is generated

REM signcode.exe /spc GSMPlayerControl.spc /k 111111 GSMPlayerControl.ocx
signcode.exe /spc GSMPlayerControl.spc /v GSMPlayerControl.pvk GSMPlayerControl.ocx
IF NOT "%ERROR%"=="" goto ERROR
echo GSMPlayerControl.ocx sign code is finished

echo chktrust -v GSMPlayerControl.ocx(或chktrust -v GSMPlayerControl.cab)

goto END

:ERROR
echo Error!!Error!!Error!!Error!!Error!!
echo %ERROR%

:END
echo chktrust -v test.ocx(或chktrust -v test.cab)
@PAUSE

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值