<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>.net ready !!! : XML</title><link>http://blogs.msdn.com/maximelamure/archive/tags/XML/default.aspx</link><description>Tags: XML</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Create your own .pfx file for ClickOnce</title><link>http://blogs.msdn.com/maximelamure/archive/2007/01/24/create-your-own-pfx-file-for-clickonce.aspx</link><pubDate>Thu, 25 Jan 2007 01:41:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1523932</guid><dc:creator>Maxime LAMURE</dc:creator><slash:comments>19</slash:comments><comments>http://blogs.msdn.com/maximelamure/comments/1523932.aspx</comments><wfw:commentRss>http://blogs.msdn.com/maximelamure/commentrss.aspx?PostID=1523932</wfw:commentRss><wfw:comment>http://blogs.msdn.com/maximelamure/rsscomments.aspx?PostID=1523932</wfw:comment><description>&lt;P&gt;&lt;FONT face=Arial color=#808080&gt;&lt;FONT color=#000000&gt;When you use ClickOnce to deploy your application with Visual Studio, a .pfx file is automatically generated by default.&lt;/FONT&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial color=#808080&gt;Reminder:&lt;BR&gt;When you want to use Authenticode signing, you need:&lt;/FONT&gt; 
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT face=Arial color=#808080&gt;· A public key (.cer file) which is given by a Certificate Authority (trusted third party)&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#808080&gt;· A private Key (.pvk file) that you generate and you keep confidential&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT face=Arial color=#808080&gt;A Personal Information Exchange (pfx file) contains a public key and a private key. You can use it to hash your files (binary, assembly …) and even signed your manifest file for ClickOnce. &lt;/FONT&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;If you want to create your own PFX file with your personal information, you have to complete these two steps:&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT face=Arial&gt;Create your public &amp;amp; private Keys (You will be prompt to define the private key’s password):&lt;BR&gt;&lt;EM&gt;makecert.exe -sv MyKey.pvk -n "CN=.NET Ready!!!" MyKey.cer&lt;/EM&gt;&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT face=Arial&gt;Create your PFX file from the public and private key &lt;BR&gt;&lt;EM&gt;pvk2pfx.exe -pvk MyKey.pvk -spc MyKey.cer -pfx MyPFX.pfx -po toto&lt;/EM&gt;&lt;/FONT&gt; 
&lt;P&gt;&lt;I&gt;&lt;FONT face=Arial&gt;Now that you have your PFX file, you can sign your application with mage or mageUI:&lt;/FONT&gt;&lt;/I&gt; 
&lt;H5&gt;With Mage: &lt;/H5&gt;
&lt;P&gt;&lt;STRONG&gt;Sign the application manifest&lt;/STRONG&gt;&lt;BR&gt;mage -sign MyApplication _1_0_0_0\ MyApplication.exe.manifest -CertFile Test.pfx -pwd "toto"&lt;BR&gt;&lt;EM&gt;With&amp;nbsp;:&lt;BR&gt;MyApplication _1_0_0_0\ MyApplication.exe.manifest&amp;nbsp;:application manifest&lt;BR&gt;Test.pfx&amp;nbsp;: pfx file (include the private and public keys)&lt;BR&gt;toto= password&lt;/EM&gt; 
&lt;P&gt;&lt;STRONG&gt;Update the deployment manifest with the application manifest&lt;/STRONG&gt;&lt;BR&gt;mage -update MyApplication.application –AppManifest MyApplication _1_0_0_0\ MyApplication.exe.manifest &lt;BR&gt;&lt;EM&gt;With&amp;nbsp;:&lt;BR&gt;MyApplication.application&amp;nbsp;: deploy manifest&lt;BR&gt;MyApplication _1_0_0_0\ MyApplication.exe.manifest&amp;nbsp;: application manifest&lt;/EM&gt; 
&lt;P&gt;&lt;STRONG&gt;Sign the deployment manifest&lt;/STRONG&gt;&lt;BR&gt;mage -sign MyApplication.application -CertFile Test.pfx -pwd "toto"&lt;BR&gt;&lt;EM&gt;With&amp;nbsp;:&lt;BR&gt;MyApplication.application&amp;nbsp;: deploy manifest&lt;BR&gt;Test.pfx&amp;nbsp;: pfx file (include the private and public keys)&lt;BR&gt;toto= password&lt;/EM&gt; 
&lt;H5&gt;With MageUI: &lt;/H5&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/maximelamure/WindowsLiveWriter/Createyourown.pfxfileforClickOnce_14D21/deploy18.jpg" atomicselection="true" mce_href="http://blogs.msdn.com/blogfiles/maximelamure/WindowsLiveWriter/Createyourown.pfxfileforClickOnce_14D21/deploy18.jpg"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=380 src="http://blogs.msdn.com/blogfiles/maximelamure/WindowsLiveWriter/Createyourown.pfxfileforClickOnce_14D21/deploy_thumb16.jpg" width=536 border=0 mce_src="http://blogs.msdn.com/blogfiles/maximelamure/WindowsLiveWriter/Createyourown.pfxfileforClickOnce_14D21/deploy_thumb16.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;Or your can define your certificate to sign your ClickOnce manifest in Visual Studio (before deployment):&lt;/FONT&gt; 
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/maximelamure/WindowsLiveWriter/Createyourown.pfxfileforClickOnce_14D21/VS9.jpg" atomicselection="true" mce_href="http://blogs.msdn.com/blogfiles/maximelamure/WindowsLiveWriter/Createyourown.pfxfileforClickOnce_14D21/VS9.jpg"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=309 src="http://blogs.msdn.com/blogfiles/maximelamure/WindowsLiveWriter/Createyourown.pfxfileforClickOnce_14D21/VS_thumb7.jpg" width=533 border=0 mce_src="http://blogs.msdn.com/blogfiles/maximelamure/WindowsLiveWriter/Createyourown.pfxfileforClickOnce_14D21/VS_thumb7.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;Now, your application will be deployed with your certificate ;-)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;Have Fun !!!&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1523932" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/maximelamure/archive/tags/ClickOnce/default.aspx">ClickOnce</category><category domain="http://blogs.msdn.com/maximelamure/archive/tags/XML/default.aspx">XML</category></item></channel></rss>