<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Bits and Bytes &#187; Uncategorized</title>
	<atom:link href="http://pa55word.wordpress.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://pa55word.wordpress.com</link>
	<description>This blog is to compile the technical programming how to do's into one place in web</description>
	<lastBuildDate>Wed, 21 Jan 2009 11:48:28 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='pa55word.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/5f580b89025f635fe56532dc7947e24b?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Bits and Bytes &#187; Uncategorized</title>
		<link>http://pa55word.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://pa55word.wordpress.com/osd.xml" title="Bits and Bytes" />
		<item>
		<title>How to get your java keystore/truststore from pem files</title>
		<link>http://pa55word.wordpress.com/2009/01/21/how-to-get-your-java-keystoretruststore-from-pem-files/</link>
		<comments>http://pa55word.wordpress.com/2009/01/21/how-to-get-your-java-keystoretruststore-from-pem-files/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 11:44:59 +0000</pubDate>
		<dc:creator>sun</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[TLS]]></category>

		<guid isPermaLink="false">http://pa55word.wordpress.com/?p=12</guid>
		<description><![CDATA[Requirement : Create JKS keystore and truststore out of certificate and private key files given in pem format.
Try to open the certificate and key files and it contains ASCII text that starts with &#8212;&#8211;BEGIN CERTIFICATE&#8212;&#8211;, then it is in PEM format.
Using keytool in java, when a keystore is created it already has the private key [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pa55word.wordpress.com&blog=1492994&post=12&subd=pa55word&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Requirement : Create JKS keystore and truststore out of certificate and private key files given in pem format.</p>
<p>Try to open the certificate and key files and it contains ASCII text that starts with &#8212;&#8211;BEGIN CERTIFICATE&#8212;&#8211;, then it is in PEM format.</p>
<p>Using keytool in java, when a keystore is created it already has the private key in it. Keytool does not allow us to import a private key into a keystore. Thus we need to use OpenSSL for this but OpenSSL creates the keystore in pkcs12 format. So we use jetty to convert our pkcs12 into jks format.</p>
<p>OpenSSL for Windows is available from <a class="external free" title="http://www.slproweb.com/products/Win32OpenSSL.html" rel="nofollow" href="http://www.slproweb.com/products/Win32OpenSSL.html">http://www.slproweb.com/products/Win32OpenSSL.html</a>.</p>
<p>Keystore to be created : keystore.pkcs12, Certificate File : test.cert.pem, PrivateKey File : test.key.pem.<br />
<strong>openssl pkcs12 -export -out keystore.pkcs12 -in test.cert.pem -inkey test.key.pem</strong><br />
Enter the appropriate password. Now using jetty we can convert the pkcs12 keystore into jks keystore (keystore.jks).<br />
<strong>java -cp c:\jetty\lib\jetty-6.1.1.jar org.mortbay.jetty.security.PKCS12Import keystore.pkcs12 keystore.jks</strong></p>
<p>Now to create truststore file.<br />
<strong>keytool -import -alias test -file test.cert.pem -keystore truststore</strong></p>
<p>where truststore is the new TrustStore in jks format. You can import as many other certificates as you need to trust into the truststore. Give the password and type y when asked trust the certificate.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pa55word.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pa55word.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pa55word.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pa55word.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pa55word.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pa55word.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pa55word.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pa55word.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pa55word.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pa55word.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pa55word.wordpress.com&blog=1492994&post=12&subd=pa55word&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pa55word.wordpress.com/2009/01/21/how-to-get-your-java-keystoretruststore-from-pem-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8dfd33724157102562bd013251affe66?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sunray</media:title>
		</media:content>
	</item>
	</channel>
</rss>