<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.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>John Howard - Senior Program Manager in the Hyper-V team at Microsoft : IIS, Information</title><link>http://blogs.technet.com/jhoward/archive/tags/IIS/Information/default.aspx</link><description>Tags: IIS, Information</description><dc:language>en-GB</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>How-to use MakeCert for trusted root certification authority and SSL certificate issuance</title><link>http://blogs.technet.com/jhoward/archive/2005/02/02/365323.aspx</link><pubDate>Wed, 02 Feb 2005 14:26:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:365323</guid><dc:creator>jhoward</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.technet.com/jhoward/comments/365323.aspx</comments><wfw:commentRss>http://blogs.technet.com/jhoward/commentrss.aspx?PostID=365323</wfw:commentRss><description>&lt;FONT face="Lucida Sans Unicode" size=2&gt;I wasn't originally going to blog this, but my colleague, &lt;A href="http://blogs.msdn.com/mat_stephen"&gt;Mat&lt;/A&gt;, and I were discussing encryption late last night. Mat was specifically interested in its use for security traffic in the context of SQL Reporting Service, but we got massively sidetracked and ended up talking about IPSec, MAPI and all sorts of other things along the way. Interesting, none-the-less.&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT face="Lucida Sans Unicode" size=2&gt;One thing Mat wanted to demonstrate was the use of a certificate for encrypting traffic between a SQL Reporting Server and a back-end database. Why not install a certificate server, he said. My retort was that he was probably barking if this was just for a simple demonstration.... :-) (You're not, really Mat. Honest!) Hence, one topic along our way was how to use MakeCert.exe to demonstrate SSL encryption. Rather than me show him and get it written down, what better way than to blog it. Makes sense, right? Spookily just last week I was reminding myself about how to use the makecert.exe utility (download link at the bottom) to generate a self-signed certificate for a completely different purpose. However, definitely a subject for another day and besides, I never did succeed in that particular goal :-(&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Lucida Sans Unicode" size=2&gt;&lt;STRONG&gt;MakeCert.exe&lt;/STRONG&gt; allows you to (for test/dev purposes) generate both a trusted root certificate and a certificate signed by that trusted root certificate for encryption purposes (also for signature purposes, but that wasn't relevant in this context). In this way, you can create a test/dev web-site, for example, with SSL encryption enabled. Follow these simple steps if this is something you need to do. I'll follow up later with an example of how you would use these generated certificates to SSL-enable a very simple web-site under IIS 6.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Lucida Sans Unicode" size=2&gt;From the command prompt, in the directory where you downloaded makecert.exe, enter all the green bits below on a single line (ie exclude my comments in the right-most column).&lt;/FONT&gt;&lt;/P&gt;
&lt;TABLE id=table10 width="100%" border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;B&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;makecert&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD noWrap&gt;&lt;B&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;-pe&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face="Arial Narrow" size=2&gt;Exportable private key&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD noWrap&gt;&lt;B&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;-n "CN=Test And Dev Root Authority"&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face="Arial Narrow" size=2&gt;Subject name&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD noWrap&gt;&lt;B&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;-ss my&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face="Arial Narrow" size=2&gt;Certificate store name&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD noWrap&gt;&lt;B&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;-sr LocalMachine&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face="Arial Narrow" size=2&gt;Certificate store location&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD noWrap&gt;&lt;B&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;-a sha1&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face="Arial Narrow" size=2&gt;Signature algorithm&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD noWrap&gt;&lt;B&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;-sky signature&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face="Arial Narrow" size=2&gt;Subject key type is for signature purposes&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD noWrap&gt;&lt;B&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;-r&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face="Arial Narrow" size=2&gt;Make a self-signed cert&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD noWrap&gt;&lt;B&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;"Test And Dev Root Authority.cer"&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face="Arial Narrow" size=2&gt;Output filename&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;&lt;FONT face="Lucida Sans Unicode" size=2&gt;You will now have a "Test And Dev Root Authority.cer" certificate on disk and a new certificate will also be installed in the LocalMachine Certificate store. If you run up a Certificates MMC at this point, you will be able to see this. However, by default, the Certificates snap-in isn't available as a short cut. Hence, use the following steps:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face="Lucida Sans Unicode" size=2&gt;Start/Run/MMC&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face="Lucida Sans Unicode" size=2&gt;File/Add-Remove Snap-In&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face="Lucida Sans Unicode" size=2&gt;Click Add&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face="Lucida Sans Unicode" size=2&gt;Select Certificates and click Add&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face="Lucida Sans Unicode" size=2&gt;Select Computer Account and hit Next&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face="Lucida Sans Unicode" size=2&gt;Select Local Computer&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face="Lucida Sans Unicode" size=2&gt;Click Close&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face="Lucida Sans Unicode" size=2&gt;Click OK&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face="Lucida Sans Unicode" size=2&gt;If you expand the console out to Personal/Certificates, you will see your newly created certificate as in the screen shot below.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Lucida Sans Unicode" size=2&gt;&lt;A href="http://www.msblogcasts.com/jhoward/makecert1.jpg" target=_blank&gt;&lt;IMG height=120 src="http://www.msblogcasts.com/jhoward/makecert1.jpg" width=251&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Lucida Sans Unicode" size=2&gt;Now that you have a root certificate, you need to use this certificate (at least the .cer file which is still present on your hard-disk) to sign another certificate you are going to use for encryption purposes. From the command prompt, enter the following&lt;/FONT&gt;&lt;/P&gt;
&lt;TABLE id=table11 width="100%" border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;B&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;makecert&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD noWrap&gt;&lt;B&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;-pe&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face="Arial Narrow" size=2&gt;Exportable private key&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD noWrap&gt;&lt;B&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;-n "CN=jhoward-5160"&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face="Arial Narrow" size=2&gt;Full DNS name of the target machine. &lt;FONT color=#ff0000&gt;&lt;I&gt;Note that in this example, I am running a machine with the NetBIOS name "jhoward-5160" which is &lt;B&gt;not&lt;/B&gt; a member of a domain. Hence, the full DNS name really is this. Replace this as appropriate. e.g. CN=mycomputer.company.com&lt;/I&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD noWrap&gt;&lt;B&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;-ss my&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face="Arial Narrow" size=2&gt;Certificate store name&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD noWrap&gt;&lt;B&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;-sr LocalMachine&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face="Arial Narrow" size=2&gt;Certificate store location&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD noWrap&gt;&lt;B&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;-a sha1&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face="Arial Narrow" size=2&gt;Signature algorithm&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD noWrap&gt;&lt;B&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;-sky exchange&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face="Arial Narrow" size=2&gt;Subject key type is for key-exchange purposes (i.e. Encryption)&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD noWrap&gt;&lt;B&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;-eku 1.3.6.1.5.5.7.3.1&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face="Arial Narrow" size=2&gt;Enhanced key usage OIDs. Trust me on this :-)&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD noWrap&gt;&lt;B&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;-in "Test And Dev Root Authority"&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face="Arial Narrow" size=2&gt;Issuers certificate common name&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD noWrap&gt;&lt;B&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;-is MY&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face="Arial Narrow" size=2&gt;Issuers certificate store name&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD noWrap&gt;&lt;B&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;-ir LocalMachine&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face="Arial Narrow" size=2&gt;Issuers certificate store location&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD noWrap&gt;&lt;B&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;-sp "Microsoft RSA SChannel Cryptographic Provider"&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face="Arial Narrow" size=2&gt;CryptoAPI providers name&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD noWrap&gt;&lt;B&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;-sy 12&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face="Arial Narrow" size=2&gt;CryptoAPI providers type&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD noWrap&gt;&lt;B&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;jhoward-5160.cer&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face="Arial Narrow" size=2&gt;Output file - &lt;FONT color=#ff0000&gt;replace and name as appropriate.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;&lt;FONT face="Lucida Sans Unicode" size=2&gt;Go back to the certificates snap-in, right-click the "Test and Dev Root Authority" certificate and copy it to the "Trusted Root Certification Authorities" node. Once done, if you expand this node, and then select certificates your newly created root cert should be present.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Lucida Sans Unicode" size=2&gt;&lt;A href="http://www.msblogcasts.com/jhoward/makecert2.jpg" target=_blank&gt;&lt;IMG height=131 src="http://www.msblogcasts.com/jhoward/makecert2.jpg" width=257&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Lucida Sans Unicode" size=2&gt;If you whizz back to the personal certificates in this snap-in, you also note that your new certificate suitable for encryption purposes is installed, as highlighted in the screen-shot below.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Lucida Sans Unicode" size=2&gt;&lt;A href="http://www.msblogcasts.com/jhoward/makecert3.jpg" target=_blank&gt;&lt;IMG height=81 src="http://www.msblogcasts.com/jhoward/makecert3.jpg" width=254&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Lucida Sans Unicode" size=2&gt;If you double-click the certificate, verify that you have a private key that corresponds to this certificate, and that the intended purpose is to ensure the identity of a remote computer.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Lucida Sans Unicode" size=2&gt;&lt;A href="http://www.msblogcasts.com/jhoward/makecert4.jpg" target=_blank&gt;&lt;IMG height=239 src="http://www.msblogcasts.com/jhoward/makecert4.jpg" width=209&gt;&lt;/A&gt;&amp;nbsp; &lt;A href="http://www.msblogcasts.com/jhoward/makecert5.jpg" target=_blank&gt;&lt;IMG height=239 src="http://www.msblogcasts.com/jhoward/makecert5.jpg" width=208&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Lucida Sans Unicode" size=2&gt;At this point, you can safely delete the "Test And Dev Root Authority" certificate from the &lt;B&gt;personal&lt;/B&gt; certificate store in the MMC snap-in. Remember also that you can save the two .cer files on disk safely away to save you remembering all the above parameters for makecert.exe. You can simply use the "All Tasks/Import" wizard in the MMC snap-in instead (assuming that the DNS name of the target machine matches).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Lucida Sans Unicode" size=2&gt;&lt;A href="http://download.microsoft.com/download/platformsdk/update/5.131.3617.0/nt45xp/en-us/makecert.exe"&gt;Download makecert.exe from microsoft.com here&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Lucida Sans Unicode" size=2&gt;Oh the fun of after-work conversations.... Hope this is useful for you&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=365323" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/jhoward/archive/tags/Windows+Server+2003/default.aspx">Windows Server 2003</category><category domain="http://blogs.technet.com/jhoward/archive/tags/How+to+Articles/default.aspx">How to Articles</category><category domain="http://blogs.technet.com/jhoward/archive/tags/Information/default.aspx">Information</category><category domain="http://blogs.technet.com/jhoward/archive/tags/Downloads/default.aspx">Downloads</category><category domain="http://blogs.technet.com/jhoward/archive/tags/IIS/default.aspx">IIS</category></item></channel></rss>