现在的位置: 首页 > 综合 > 正文

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

2017年11月25日 ⁄ 综合 ⁄ 共 1479字 ⁄ 字号 评论关闭

   通过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/

 

 

抱歉!评论已关闭.