CREATE A NON-EXPIRING TEST CERTIFICATE (PFX) FOR CLICKONCE APPLICATIONS

本文介绍如何为ClickOnce应用程序创建非过期测试证书。除购买正式证书外,您还可以自行制作测试证书。Visual Studio 2010虽提供简易创建方式但定制性有限。本文提供了一个使用makecert及pvk2pfx工具创建更个性化测试证书的脚本示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

http://bernhardelbl.wordpress.com/2012/03/20/create-a-non-expiring-test-certificate-pfx-for-clickonce-applications/

CREATE A NON-EXPIRING TEST CERTIFICATE (PFX) FOR CLICKONCE APPLICATIONS

A ClickOnce application must be signed using a certificate. You can buy a real certificate or create a Test Certificate by your own. Visual Studio 2010 helps in creating such a Test Certificate. It offers a wizard and is very easy to use. The draw-back of the simple feature is that you can not do customization.

Create a Test Certificate in Visual Studio

Disadvantages of Visual Studio Test Certificate

If you want to deploy your application with such a Test Certificate you need to consider the following disadvantages:

  • “Issued To” and “Issued By” will contain the user name of your current windows account
  • “Expiration Date” is set to “Expires in one year”

Create a more customized Test Certificate (pfx)

If you want to create a more customized Test Certificate, you can do that by using the following script.

makecert -sv ClickOnceTestApp.pvk
         -n CN=Sample ClickOnceTestApp.cer
         -b 01/01/2012 -e 12/31/2100 -r
pvk2pfx -pvk "ClickOnceTestApp.pvk"
        -spc "ClickOnceTestApp.cer"
        -pfx "ClickOnceTestApp.pfx"

To learn more about the used tools
Makecert
http://msdn.microsoft.com/en-us/library/bfsktky3%28v=vs.80%29.aspx

Pvk2Pfx
http://msdn.microsoft.com/en-us/library/windows/hardware/ff550672%28v=vs.85%29.aspx

Add your Test Certificate to your Visual Studio Project

If you add your custom Test Certificate to your Visual Studio Project it will look like this.

Download the Script Sample

http://dl.dropbox.com/u/40751518/CodeSamples/MakeCert.zip


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值