Tuesday, January 11, 2011

How to change the expiration date of certificates- ClickOnce .pfx file

Certificate (.pfx file) is use to sing your “ClickOnece” application. It has expiration date. By default first publish allows one year time period as expiration date. Mean time you can publish several version of your “ClickOnce”. Once certificate get expired visual studio not allows publishing “ClickOnce” application. You have to re-create a certificate and publish again. But the entire client machines which are using your application have to uninstall application and reinstall it again. This is not faire if you have number of clients.

Here is the solution to extend expiration date of certificate.

Using RenewCert.exe file. Here is the command to renew certificate.

Renewcert [PFX File] [new cert filename] [new cert friendly name] [optional] [password]

Example :

Renewcert oldcert.pfx newcert.pfx “CN=MyNewCert” MySuperSecretPassword

Blogs say RenewCert.exe file is come with Windows SDK , VS 2010 , but I could not find it after install SDK or VS 2010 (C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin) . Click here to download the file.