{"id":645,"date":"2006-12-13T17:18:06","date_gmt":"2006-12-14T01:18:06","guid":{"rendered":"\/?p=645"},"modified":"2006-12-15T18:53:55","modified_gmt":"2006-12-16T02:53:55","slug":"creating-test-certificates","status":"publish","type":"post","link":"https:\/\/www.identityblog.com\/?p=645","title":{"rendered":"Creating a Certificate Authority for Test Certificates"},"content":{"rendered":"<p>You can use any Certificate Authority (CA) to create test certificates.&nbsp; This description is intended for people who don&#39;t have a CA.&nbsp; It tells you how to create&nbsp;test certificates&nbsp;that can be used when developing&nbsp;CardSpace&nbsp;relying parties and managed card services.&nbsp; Since CardSpace is part of a wider WS-Trust and InfoCard ecology,&nbsp;the&nbsp;same certificates will work with other software being developed within&nbsp;the cross-platform identity metasystem.<\/p>\n<p>This&nbsp;recipe uses OpenSSL since&nbsp;it is available on virtually every platform and well suited to a test environment.&nbsp;&nbsp;I&#39;m assuming people with Microsoft Certificate Server already know how to&nbsp;produce certificates.&nbsp; Later in this series I&#39;ll explain&nbsp;how to produce and install high assurance certs.<\/p>\n<p>My goal is to&nbsp;get&nbsp;you&nbsp;past certificate issues&nbsp;with the least muss and fuss.&nbsp; You should turn to other resources&nbsp;if you want&nbsp;an in-depth&nbsp;background on X509 or a description of how OpenSSL works.<\/p>\n<p><strong>Download OpenSSL and DemoCA<\/strong><\/p>\n<p>First, you need <strong>openssl<\/strong> binaries.&nbsp; A number of linux distributions have&nbsp;them preinstalled.&nbsp; If your OS doesn&#39;t, visit <a href=\"http:\/\/www.openssl.org\/\">http:\/\/www.openssl.org\/<\/a>.&nbsp; If possible find the binary distribution so you don&#39;t have to compile anything.&nbsp; Distributions&nbsp;are posted <a href=\"http:\/\/www.openssl.org\/related\/binaries.html\">here<\/a>.&nbsp; OpenSSL for Windows&nbsp;is available <a href=\"http:\/\/www.slproweb.com\/products\/Win32OpenSSL.html\">here<\/a>.<\/p>\n<p>Once you have your binaries installed, download <a href=\"\/wp-content\/resources\/democa.zip\" class=\"broken_link\">DemoCA ZIP<\/a>, which I have produced to accompany this tutorial.&nbsp; Create a directory which is a sibling of&nbsp;the openssl\/bin directory &#8211; for example. openssl\/democa.&nbsp; Extract the files from the zip into the directory.&nbsp;&nbsp;If you are not on Windows you&#39;ll have to convert the batch files to scripts of some sort, but this will be totally trivial.<\/p>\n<p><em>NOTE:&nbsp; Click to enlarge the images below&nbsp;if you want to&nbsp;see what the scripts output to the screen.&nbsp;&nbsp;But base yourself on the DemoCA scripts, not just what you see here.<\/em><\/p>\n<p><strong>Create a Certificate Authority<\/strong>&nbsp;<\/p>\n<p>The&nbsp;Certificate Authority is a <strong>factory for certificates<\/strong>.&nbsp; You put a &#8220;certificate request&#8221; into the factory and out comes&nbsp;a certificate&nbsp;attested to&nbsp;by the factory.&nbsp; So the first thing&nbsp;you need is the Certificate Authority, which has its own certificate and private key.&nbsp;&nbsp;<\/p>\n<p>From within the directory you just created, run &#8220;createca&#8221; and&nbsp;answer the prompts&nbsp;with suitable values (use the defaults I give as a guide).<\/p>\n<table>\n<tr>\n<td><a href=\"\/wp-content\/images\/2006\/12\/createca.gif\"><img title=\"Create CA screenshot\" alt=\"Create CA screenshot\" src=\"\/wp-content\/images\/2006\/12\/createca-thumb.gif\" \/><\/a><\/td>\n<td style=\"font-size: 70%\">Click screenshot<br \/>\nto enlarge it.<\/td>\n<\/tr>\n<\/table>\n<p>&nbsp;<\/p>\n<p>This&nbsp;places your CA certificate&nbsp;in democa\/cacert.crt, and stores the&nbsp;corresponding private key in &#8220;democa\/private\/cakey.pem.&nbsp; The private key is protected by the pass phrase you entered.&nbsp; <em>Remember this passphrase as your Certificate Authority passphrase.&nbsp; You&#39;ll need it whenever you want to create a certificate.<\/em><\/p>\n<p><strong>Examining your CA certificate<\/strong><\/p>\n<p>You can make sure the certificate is correct by looking at it on a Windows box.&nbsp; Double click on the cacert.crt file and you will see:<\/p>\n<table>\n<tr>\n<td><a href=\"\/wp-content\/images\/2006\/12\/cacert-page1.jpg\"><img src=\"\/wp-content\/images\/2006\/12\/cacert-page1-thumbnail.jpg\" \/><\/a><\/td>\n<td style=\"font-size: 70%\">Click screenshot<br \/>\nto enlarge it.<\/td>\n<\/tr>\n<\/table>\n<p>You&#39;ll see the certificate isn&#39;t &#8220;trusted&#8221; yet.&nbsp; No problem &#8211; it shouldn&#39;t be trusted, given that you haven&#39;t installed it yet (installation is the indication that you trust it).&nbsp; We show installation&nbsp;elsewhere in this guide.&nbsp;<\/p>\n<p>Go to the &#8220;Details&#8221; pane and highlight &#8220;Subject&#8221;.&nbsp; You will see the name of&nbsp;your Certificate Authority.<\/p>\n<table>\n<tr>\n<td><a href=\"\/wp-content\/images\/2006\/12\/cacert-subject.jpg\"><img src=\"\/wp-content\/images\/2006\/12\/cacert-subject-thumbnail.jpg\" \/><\/a><\/td>\n<td style=\"font-size: 70%\">Click screenshot<br \/>\nto enlarge it.<\/td>\n<\/tr>\n<\/table>\n<p>Finally, highlight &#8220;Basic Constraints&#8221;.&nbsp; You should see Subject Type=CA.&nbsp; If you don&#39;t, something has gone wrong &#8211; and you don&#39;t have a CA cert.&nbsp;<\/p>\n<table>\n<tr>\n<td><a href=\"\/wp-content\/images\/2006\/12\/cacert-constraints.jpg\"><img src=\"\/wp-content\/images\/2006\/12\/cacert-constraints-thumbnail.jpg\" \/><\/a><\/td>\n<td style=\"font-size: 70%\">Click screenshot<br \/>\nto enlarge it.<\/td>\n<\/tr>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>You can use any Certificate Authority (CA) to create test certificates.&nbsp; This description is intended for people who don&#39;t have a CA.&nbsp; It tells you how to create&nbsp;test certificates&nbsp;that can be used when developing&nbsp;CardSpace&nbsp;relying parties and managed card services.&nbsp; Since CardSpace is part of a wider WS-Trust and InfoCard ecology,&nbsp;the&nbsp;same certificates will work with other &hellip; <a href=\"https:\/\/www.identityblog.com\/?p=645\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Creating a Certificate Authority for Test Certificates<\/span><\/a><\/p>\n","protected":false},"author":68,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.identityblog.com\/index.php?rest_route=\/wp\/v2\/posts\/645"}],"collection":[{"href":"https:\/\/www.identityblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.identityblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.identityblog.com\/index.php?rest_route=\/wp\/v2\/users\/68"}],"replies":[{"embeddable":true,"href":"https:\/\/www.identityblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=645"}],"version-history":[{"count":0,"href":"https:\/\/www.identityblog.com\/index.php?rest_route=\/wp\/v2\/posts\/645\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.identityblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=645"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.identityblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=645"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.identityblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=645"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}