<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Vidar's Musings &#187; java</title>
	<atom:link href="http://www.kongsli.net/nblog/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kongsli.net/nblog</link>
	<description>Deep thoughts on shallow topics</description>
	<lastBuildDate>Fri, 27 Jan 2012 07:36:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Java Keystore walkthrough</title>
		<link>http://www.kongsli.net/nblog/2006/09/22/java-keystore-walkthrough/</link>
		<comments>http://www.kongsli.net/nblog/2006/09/22/java-keystore-walkthrough/#comments</comments>
		<pubDate>Fri, 22 Sep 2006 07:39:00 +0000</pubDate>
		<dc:creator>vidarkongsli</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[keystore]]></category>
		<category><![CDATA[pki]]></category>

		<guid isPermaLink="false">http://www.kongsli.net/nblog/?p=14</guid>
		<description><![CDATA[The Java keystore is powerful, yet not very user-friendly. While the Java documentation provides an OK reference on keystore commands, there are not many comprehensive examples out there. So, here is a simple walkthrough on how to create your keystore containing your private key, your signed certificate, and the certificate of the CA that signed [...]]]></description>
			<content:encoded><![CDATA[<p>The Java keystore is powerful, yet not very user-friendly. While the Java documentation provides an OK reference on keystore commands, there are not many comprehensive examples out there.</p>

<p>So, here is a simple walkthrough on how to create your keystore containing your private key, your signed certificate, and the certificate of the CA that signed your certificate.</p>

<blockquote>
REM &#8220;Step 1: Create your store and your private/public key pair&#8221;
keytool -genkey -dname &#8220;cn=myhost,c=mycompany&#8221; -alias myhost -keypass z0Ld6#MdeR -validity 365 -keystore mykeystore.jks -storepass kru6+Qb76_

REM &#8220;Step 2: Create a Certificate Signing Request (CSR)&#8221;
keytool -certreq -alias myhost -file myhost.csr -keypass z0Ld6#MdeR -keystore mykeystore.jks -storepass kru6+Qb76_

REM &#8220;Step 3: Import CA certificate into keystore, and make it trusted&#8221;
keytool -import -alias myCA -file c:\myca.cer -keystore mykeystore.jks -storepass kru6+Qb76_

REM &#8220;Step 4: import my signed personal certificate&#8221;
keytool -import -file c:\myhost.cer -keystore mykeystore.jks -storepass kru6+Qb76_

REM &#8220;Step 5: list and verify certificates&#8221;
keytool -list -keystore mykeystore.jks -storepass kru6+Qb76_</blockquote>

<p>Comments:</p>

<ul>
    <li>If you shall use the certificate for securing browser communication using SSL, make sure the common name (CN) is the fully qualified hostname of your server, e.g. myhost.domain.com.</li>
    <li>When it comes to choosing key length, use <a title="Link to www.keylength.com" href="http://www.keylength.com/">www.keylength.com</a> as reference.</li>
    <li>Between step 2 and 3 above, you have to have the certificate signed by a certificate authority like<a title="Link to VeriSign web site" href="http://www.verisign.com"> VeriSign</a>. Alternatively, you can set up your own CA in your company using<a href="http://www.openssl.org/"> OpenSSL</a> or <a title="Link to page describing building a Public Key Infrastructure on Windows 2003" href="http://www.microsoft.com/windowsserver2003/technologies/pki/default.mspx">Windows Certificate Services</a></li>
    <li>Please do not use the same passwords as shown above. That would not be very wise&#8230;</li>
</ul>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.kongsli.net%2Fnblog%2F2006%2F09%2F22%2Fjava-keystore-walkthrough%2F&amp;title=Java%20Keystore%20walkthrough" id="wpa2a_2"><img src="http://www.kongsli.net/nblog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.kongsli.net/nblog/2006/09/22/java-keystore-walkthrough/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

