通过ClickOnce发布程序,通过Create Test Certificate创建证书,证书过期的解决方案

   通过ClickOnce发布程序.通过Create Test Certificate创建的证书只有一年有效期,如果一年后用户重新发布应用那么在客户端用户升级的时候就会报错,如何解决这个问题呢?通过google找到了牛人的解决方案,并将其贴出来.这个是解决方案:

The Solution

I have modified the Microsoft code to put in a test for success after each and every function call. I preserve the provider info structure from the old key to use when creating the new key. This seems to work but I have only tested it with a very limited number of keys.

The revised code can be found on my Subversion server in the file RenewCert.cpp. I apologise in advance for the state of this code … I got it to work and stopped fiddling. Maybe one day I'll rewrite it as a Windows application.

In the meanwhile, you can download the project as a zip file or simply download the executable from this site. The project is also available from the Subversion Server, Please let me know how you get on with it. Microsoft developers, please feel free to update your support pages with code from here. Better still, Microsoft, maybe you should re-write the solution properly.

How To Use

On the Microsoft page, it tells you to execute the following command:

renewcert <OldCertificate>.pfx <NewCertificate>.pfx /"CN=<NewCertificateName>/" <Password>

This has confused a number of people as it has the effect of passing the quotes into the third parameter. The correct syntax is:

renewcert <OldCertificate>.pfx <NewCertificate>.pfx CN=<NewCertificateName> <Password>

Where the items in <> (including the <>) are replaced with the appropriate names. If any parameter has a space or backslash in it, you should surround that parameter with quotes. e.g.:

renewcert maybe.pfx "new maybe.pfx" CN=NewName secret

 

 

Author BLOG  http://robindotnet.wordpress.com/

Article URL   http://may.be/renewcert/

 

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值