<?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>MattPayne.org &#187; Java</title>
	<atom:link href="http://www.mattpayne.org/blog/category/programming/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mattpayne.org/blog</link>
	<description>Omaha, NE - Computer Programmer</description>
	<lastBuildDate>Fri, 26 Mar 2010 00:52:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Scala</title>
		<link>http://www.mattpayne.org/blog/2009/07/18/scala/</link>
		<comments>http://www.mattpayne.org/blog/2009/07/18/scala/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 14:06:05 +0000</pubDate>
		<dc:creator>Payne</dc:creator>
				<category><![CDATA[Scala]]></category>

		<guid isPermaLink="false">http://www.mattpayne.org/blog/?p=319</guid>
		<description><![CDATA[All the buzz about Scala in the popular press has gotten my attention.   Hopefully, Scala will not disappoint.
From InfoQ: Roundup: Scala as the long term replacement for Java
&#8220;Scala has been receiving much attention lately as a possible candidate to replace Java in the future. James Strachan creator of Groovy advocates    [...]]]></description>
			<content:encoded><![CDATA[<p>All the buzz about Scala in the popular press has gotten my attention.   Hopefully, Scala will not disappoint.</p>
<p>From <a href="http://www.infoq.com/news/2009/07/scala-replace-java">InfoQ: Roundup: Scala as the long term replacement for Java</a></p>
<blockquote><p>&#8220;Scala has been receiving much attention lately as a possible candidate to replace Java in the future. James Strachan creator of Groovy <a href="http://macstrac.blogspot.com/2009/04/scala-as-long-term-replacement-for.html">advocates     in favor of Scala</a> as James Gosling, creator of Java and Charles Nutter JRuby     Core Developer, have done in the past.&#8221;</p></blockquote>
<p>Things I&#8217;m looking through include:</p>
<ol>
<li><a href="http://www.scala-lang.org/node/1305">Learning Scala</a></li>
<li><a href="http://programming-scala.labs.oreilly.com/">Programming Scala</a> from Ora.com seems to be online in HTML for free (for now)</li>
<li><a href="http://www.ibm.com/developerworks/views/java/libraryview.jsp?end_no=100&amp;lcl_sort_order=desc&amp;type_by=All+Types&amp;sort_order=asc&amp;show_all=false&amp;start_no=1&amp;sort_by=Date&amp;search_by=scala+neward&amp;topic_by=All+topics+and+related+products&amp;search_flag=true&amp;show_abstract=true">Ted Neward&#8217;s Busy Developers Guide to Scala series</a> on Developerworks</li>
<li><a href="http://www.scala-lang.org/docu/files/ScalaByExample.pdf">Scala By Example</a></li>
<li><a href="http://www.scala-lang.org/node/1826">Scala on Google App Engine</a></li>
</ol>
<p>I&#8217;m considering buying the book on Scala &#8212; <a href="http://www.artima.com/shop/programming_in_scala">Programming in Scala</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattpayne.org/blog/2009/07/18/scala/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JVM is the new UNIX</title>
		<link>http://www.mattpayne.org/blog/2007/02/13/jvm-is-the-new-unix/</link>
		<comments>http://www.mattpayne.org/blog/2007/02/13/jvm-is-the-new-unix/#comments</comments>
		<pubDate>Tue, 13 Feb 2007 20:43:22 +0000</pubDate>
		<dc:creator>Payne</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.mattpayne.org/blog/2007/02/13/jvm-is-the-new-unix/</guid>
		<description><![CDATA[The Java Virtual Machine is the new UNIX.  This has been happening for quite sometime and I&#8217;ve been rambling about it for a while.  This post will expand upon the idea&#8230;.. someday.
]]></description>
			<content:encoded><![CDATA[<p>The Java Virtual Machine is the new UNIX.  This has been happening for quite sometime and I&#8217;ve been rambling about it for a while.  This post will expand upon the idea&#8230;.. someday.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattpayne.org/blog/2007/02/13/jvm-is-the-new-unix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JSch is easy to use!</title>
		<link>http://www.mattpayne.org/blog/2006/09/17/jsch-is-easy-to-use/</link>
		<comments>http://www.mattpayne.org/blog/2006/09/17/jsch-is-easy-to-use/#comments</comments>
		<pubDate>Sun, 17 Sep 2006 11:42:40 +0000</pubDate>
		<dc:creator>Payne</dc:creator>
				<category><![CDATA[Crypto]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[jMatter]]></category>

		<guid isPermaLink="false">http://www.mattpayne.org/blog/2006/09/17/jsch-is-easy-to-use/</guid>
		<description><![CDATA[&#8220;JSch is a pure Java implementation of                SSH2.&#8221;  It&#8217;s great that the license is BSD style.

This package is easy to use and comes with some nice demo programs.   I was able to quickly adapt their SSH tunnels [...]]]></description>
			<content:encoded><![CDATA[<p><strong>&#8220;<a href="http://www.jcraft.com/jsch/">JSch</a> is a pure Java implementation of                <a href="http://ietf.org/html.charters/secsh-charter.html" target="_blank">SSH2</a>.&#8221;  It&#8217;s great that the <a href="http://www.jcraft.com/jsch/LICENSE.txt">license</a> is BSD style.<br />
</strong></p>
<p>This package is easy to use and comes with some <a href="http://www.jcraft.com/jsch/examples/">nice demo programs</a>.   I was able to quickly adapt <a href="http://www.jcraft.com/jsch/examples/PortForwardingL.java">their SSH tunnels demo</a> so that before starting the real main in a <a href="http://jmatter.org/">jMatter.org</a> application (which was being launched via <a href="http://java.sun.com/products/javawebstart/">Java Web Start</a>) a <a href="http://www.rzg.mpg.de/networking/tunnelling.html">SSH tunnel</a> was established.  Then the jMatter.org application makes a database connection to 127.0.0.1 which really goes through the SSH tunnel to the UNIX box with the database server on it.  This way the database server&#8217;s TCP socket doesn&#8217;t have to be directly exposed to the Internet.</p>
<p>Still to do is tweaking things so each end user has a unique tunnel&#8230; maybe with ssh keys&#8230;</p>
<p>BTW It&#8217;s interesting that the top page returned by googling SSH tunnel is <a href="http://www.rzg.mpg.de/networking/tunnelling.html">http://www.rzg.mpg.de/networking/tunnelling.html</a>.  There&#8217;s a nice picture there:</p>
<p><img src="http://mattpayne.org/i/ssh-tunnel-01.gif" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattpayne.org/blog/2006/09/17/jsch-is-easy-to-use/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VisualComplexity.com</title>
		<link>http://www.mattpayne.org/blog/2006/06/25/visualcomplexitycom/</link>
		<comments>http://www.mattpayne.org/blog/2006/06/25/visualcomplexitycom/#comments</comments>
		<pubDate>Sun, 25 Jun 2006 17:47:07 +0000</pubDate>
		<dc:creator>Payne</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Semantic Web]]></category>

		<guid isPermaLink="false">http://www.mattpayne.org/blog/2006/06/25/visualcomplexitycom/</guid>
		<description><![CDATA[I started listening to Manuel Lima&#8217;s
ITconversations.com podcast about his website
VisualComplexity.com where he collects different projects for  Mapping Complex Networks.
Very interesting stuff!   Reminds me that I want to learn the java side of Piccolo Toolkit.
]]></description>
			<content:encoded><![CDATA[<p>I started listening to <a href="http://www.mslima.com/myhome.html">Manuel Lima</a>&#8217;s<br />
<a href="http://www.itconversations.com/shows/detail1066.html">ITconversations.com</a> podcast about his website<br />
<a href="http://VisualComplexity.com">VisualComplexity.com</a> where he collects different projects for  Mapping Complex Networks.</p>
<p>Very interesting stuff!   Reminds me that I want to learn the java side of <a href="http://www.cs.umd.edu/hcil/jazz/">Piccolo Toolkit</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattpayne.org/blog/2006/06/25/visualcomplexitycom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XMLEncoder and XMLDecoder Reminder</title>
		<link>http://www.mattpayne.org/blog/2006/06/25/xmlencoder-and-xmldecoder-reminder/</link>
		<comments>http://www.mattpayne.org/blog/2006/06/25/xmlencoder-and-xmldecoder-reminder/#comments</comments>
		<pubDate>Sun, 25 Jun 2006 11:19:19 +0000</pubDate>
		<dc:creator>Payne</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.mattpayne.org/blog/2006/06/25/xmlencoder-and-xmldecoder-reminder/</guid>
		<description><![CDATA[ 1  // From old blog post http://tinyurl.com/lo88j
 2  import java.beans.*;
 3  import java.io.*;
 4  /**
 5   * This shows that with J2SE 1.4.x's built in XMLEncoder class it's 
 6   * easy to serialize javabeans (POJOs) to XML files.
 7   * @see SimpleBean
 8 [...]]]></description>
			<content:encoded><![CDATA[<pre><span style="color: #804040;"> 1</span>  <span style="color: #0000ff;">// From old blog post <a href="http://tinyurl.com/lo88j">http://tinyurl.com/lo88j</a></span>
<span style="color: #804040;"> 2</span>  <span style="color: #a020f0;">import</span> java.beans.*;
<span style="color: #804040;"> 3</span>  <span style="color: #a020f0;">import</span> java.io.*;
<span style="color: #804040;"> 4</span>  <span style="color: #0000ff;">/**</span>
<span style="color: #804040;"> 5</span>  <span style="color: #0000ff;"> *</span><span style="color: #6a5acd;"> This shows that with J2SE 1.4.x's built in XMLEncoder class it's </span>
<span style="color: #804040;"> 6</span>  <span style="color: #0000ff;"> *</span><span style="color: #6a5acd;"> easy to serialize javabeans (POJOs) to XML files.</span>
<span style="color: #804040;"> 7</span>  <span style="color: #0000ff;"> * </span><span style="color: #6a5acd;">@see</span><span style="color: #008080;"> SimpleBean</span>
<span style="color: #804040;"> 8</span>  <span style="color: #0000ff;"> * </span>
<span style="color: #804040;"> 9</span>  <span style="color: #0000ff;"> * Experiment based on </span>
<span style="color: #804040;">10</span>  <span style="color: #0000ff;"> * <a href="http://java.sun.com/products/jfc/tsc/articles/persistence4/index.html">http://java.sun.com/products/jfc/tsc/articles/persistence4/index.html</a></span>
<span style="color: #804040;">11</span>  <span style="color: #0000ff;"> * and </span>
<span style="color: #804040;">12</span>  <span style="color: #0000ff;"> * <a href="http://www-106.ibm.com/developerworks/java/library/j-mer0731/index.html">http://www-106.ibm.com/developerworks/java/library/j-mer0731/index.html</a></span>
<span style="color: #804040;">13</span>  <span style="color: #0000ff;"> * </span>
<span style="color: #804040;">14</span>  <span style="color: #0000ff;"> * Running this program creates test.xml:</span>
<span style="color: #804040;">15</span>  <span style="color: #0000ff;"> * </span>
<span style="color: #804040;">16</span>  <span style="color: #008080;">&lt;?xml </span><span style="color: #2e8b57;"><strong>version</strong></span><span style="color: #008080;">=</span><span style="color: #ff00ff;">"1.0"</span><span style="color: #008080;"> encoding=</span><span style="color: #ff00ff;">"UTF-8"</span><span style="color: #008080;">?&gt;</span>
<span style="color: #804040;">17</span>  <span style="color: #008080;">&lt;</span>java<span style="color: #008080;"> </span><span style="color: #2e8b57;"><strong>version</strong></span><span style="color: #008080;">=</span><span style="color: #ff00ff;">"1.4.2_01"</span><span style="color: #008080;"> </span><span style="color: #2e8b57;"><strong>class</strong></span><span style="color: #008080;">=</span><span style="color: #ff00ff;">"java.beans.XMLDecoder"</span><span style="color: #008080;">&gt;</span>
<span style="color: #804040;">18</span>  <span style="color: #0000ff;"> </span><span style="color: #008080;">&lt;</span><span style="color: #804040;"><strong>object</strong></span><span style="color: #008080;"> </span><span style="color: #2e8b57;"><strong>class</strong></span><span style="color: #008080;">=</span><span style="color: #ff00ff;">"SimpleBean"</span><span style="color: #008080;">&gt;</span>
<span style="color: #804040;">19</span>  <span style="color: #0000ff;">  </span><span style="color: #008080;">&lt;</span>void<span style="color: #008080;"> property=</span><span style="color: #ff00ff;">"age"</span><span style="color: #008080;">&gt;</span>
<span style="color: #804040;">20</span>  <span style="color: #0000ff;">   </span><span style="color: #008080;">&lt;</span>int<span style="color: #008080;">&gt;</span><span style="color: #0000ff;">99</span><span style="color: #008080;">&lt;/</span>int<span style="color: #008080;">&gt;</span>
<span style="color: #804040;">21</span>  <span style="color: #0000ff;">  </span><span style="color: #008080;">&lt;/</span>void<span style="color: #008080;">&gt;</span>
<span style="color: #804040;">22</span>  <span style="color: #0000ff;">  </span><span style="color: #008080;">&lt;</span>void<span style="color: #008080;"> property=</span><span style="color: #ff00ff;">"favorites"</span><span style="color: #008080;">&gt;</span>
<span style="color: #804040;">23</span>  <span style="color: #0000ff;">   </span><span style="color: #008080;">&lt;</span>void<span style="color: #008080;"> </span><span style="color: #2e8b57;"><strong>method</strong></span><span style="color: #008080;">=</span><span style="color: #ff00ff;">"add"</span><span style="color: #008080;">&gt;</span>
<span style="color: #804040;">24</span>  <span style="color: #0000ff;">    </span><span style="color: #008080;">&lt;</span>string<span style="color: #008080;">&gt;</span><span style="color: #0000ff;">Red</span><span style="color: #008080;">&lt;/</span>string<span style="color: #008080;">&gt;</span>
<span style="color: #804040;">25</span>  <span style="color: #0000ff;">   </span><span style="color: #008080;">&lt;/</span>void<span style="color: #008080;">&gt;</span>
<span style="color: #804040;">26</span>  <span style="color: #0000ff;">   </span><span style="color: #008080;">&lt;</span>void<span style="color: #008080;"> </span><span style="color: #2e8b57;"><strong>method</strong></span><span style="color: #008080;">=</span><span style="color: #ff00ff;">"add"</span><span style="color: #008080;">&gt;</span>
<span style="color: #804040;">27</span>  <span style="color: #0000ff;">    </span><span style="color: #008080;">&lt;</span>string<span style="color: #008080;">&gt;</span><span style="color: #0000ff;">Green</span><span style="color: #008080;">&lt;/</span>string<span style="color: #008080;">&gt;</span>
<span style="color: #804040;">28</span>  <span style="color: #0000ff;">   </span><span style="color: #008080;">&lt;/</span>void<span style="color: #008080;">&gt;</span>
<span style="color: #804040;">29</span>  <span style="color: #0000ff;">   </span><span style="color: #008080;">&lt;</span>void<span style="color: #008080;"> </span><span style="color: #2e8b57;"><strong>method</strong></span><span style="color: #008080;">=</span><span style="color: #ff00ff;">"add"</span><span style="color: #008080;">&gt;</span>
<span style="color: #804040;">30</span>  <span style="color: #0000ff;">    </span><span style="color: #008080;">&lt;</span>string<span style="color: #008080;">&gt;</span><span style="color: #0000ff;">Blue</span><span style="color: #008080;">&lt;/</span>string<span style="color: #008080;">&gt;</span>
<span style="color: #804040;">31</span>  <span style="color: #0000ff;">   </span><span style="color: #008080;">&lt;/</span>void<span style="color: #008080;">&gt;</span>
<span style="color: #804040;">32</span>  <span style="color: #0000ff;">  </span><span style="color: #008080;">&lt;/</span>void<span style="color: #008080;">&gt;</span>
<span style="color: #804040;">33</span>  <span style="color: #0000ff;">  </span><span style="color: #008080;">&lt;</span>void<span style="color: #008080;"> property=</span><span style="color: #ff00ff;">"name"</span><span style="color: #008080;">&gt;</span>
<span style="color: #804040;">34</span>  <span style="color: #0000ff;">   </span><span style="color: #008080;">&lt;</span>string<span style="color: #008080;">&gt;</span><span style="color: #0000ff;">Testing</span><span style="color: #008080;">&lt;/</span>string<span style="color: #008080;">&gt;</span>
<span style="color: #804040;">35</span>  <span style="color: #0000ff;">  </span><span style="color: #008080;">&lt;/</span>void<span style="color: #008080;">&gt;</span>
<span style="color: #804040;">36</span>  <span style="color: #0000ff;"> </span><span style="color: #008080;">&lt;/</span><span style="color: #804040;"><strong>object</strong></span><span style="color: #008080;">&gt;</span>
<span style="color: #804040;">37</span>  <span style="color: #008080;">&lt;/</span>java<span style="color: #008080;">&gt;</span>
<span style="color: #804040;">38</span>  <span style="color: #0000ff;"> * </span>
<span style="color: #804040;">39</span>  <span style="color: #0000ff;"> * </span>
<span style="color: #804040;">40</span>  <span style="color: #0000ff;"> * </span>
<span style="color: #804040;">41</span>  <span style="color: #0000ff;"> */</span>
<span style="color: #804040;">42</span>  <span style="color: #2e8b57;"><strong>public</strong></span> <span style="color: #2e8b57;"><strong>class</strong></span> XMLEncoderDemo {
<span style="color: #804040;">43</span>
<span style="color: #804040;">44</span>          <span style="color: #2e8b57;"><strong>public</strong></span> <span style="color: #2e8b57;"><strong>static</strong></span> <span style="color: #2e8b57;"><strong>void</strong></span> main(String[] args) {
<span style="color: #804040;">45</span>                  <span style="color: #804040;"><strong>try</strong></span> {
<span style="color: #804040;">46</span>                          <span style="color: #804040;"><strong>new</strong></span> XMLEncoderDemo().run(args);
<span style="color: #804040;">47</span>                          System.out.println(<span style="color: #ff00ff;">"Normal termination."</span>);
<span style="color: #804040;">48</span>                  } <span style="color: #804040;"><strong>catch</strong></span> (Exception bland) {
<span style="color: #804040;">49</span>                          bland.printStackTrace();
<span style="color: #804040;">50</span>                  }
<span style="color: #804040;">51</span>          }<span style="color: #0000ff;">//main()</span>
<span style="color: #804040;">52</span>
<span style="color: #804040;">53</span>          <span style="color: #2e8b57;"><strong>public</strong></span> <span style="color: #2e8b57;"><strong>void</strong></span> run(String[] args) <span style="color: #2e8b57;"><strong>throws</strong></span> Exception {
<span style="color: #804040;">54</span>                  XMLEncoder e;
<span style="color: #804040;">55</span>
<span style="color: #804040;">56</span>                  SimpleBean foo = <span style="color: #804040;"><strong>new</strong></span> SimpleBean();
<span style="color: #804040;">57</span>                  foo.setAge(<span style="color: #ff00ff;">99</span>);
<span style="color: #804040;">58</span>                  foo.setName(<span style="color: #ff00ff;">"Testing"</span>);
<span style="color: #804040;">59</span>                  foo.addFavorite(<span style="color: #ff00ff;">"Red"</span>);
<span style="color: #804040;">60</span>                  foo.addFavorite(<span style="color: #ff00ff;">"Green"</span>);
<span style="color: #804040;">61</span>                  foo.addFavorite(<span style="color: #ff00ff;">"Blue"</span>);
<span style="color: #804040;">62</span>                  <span style="color: #0000ff;">/* If SimpleBean is not a public class, this generates:</span>
<span style="color: #804040;">63</span>  <span style="color: #0000ff;">java.lang.IllegalAccessException: Class java.beans.Statement can not access a member of class SimpleBean with modifiers "public"</span>
<span style="color: #804040;">64</span>  <span style="color: #0000ff;">Continuing ...</span>
<span style="color: #804040;">65</span>  <span style="color: #0000ff;">java.lang.Exception: discarding statement XMLEncoder0.writeObject(SimpleBean0);</span>
<span style="color: #804040;">66</span>  <span style="color: #0000ff;">Continuing ...</span>
<span style="color: #804040;">67</span>  <span style="color: #0000ff;">                 */</span>
<span style="color: #804040;">68</span>                  e = <span style="color: #804040;"><strong>new</strong></span> XMLEncoder(
<span style="color: #804040;">69</span>                                          <span style="color: #804040;"><strong>new</strong></span> BufferedOutputStream(
<span style="color: #804040;">70</span>                                                  <span style="color: #804040;"><strong>new</strong></span> FileOutputStream(<span style="color: #ff00ff;">"test.xml"</span>)));
<span style="color: #804040;">71</span>                  e.writeObject(foo);
<span style="color: #804040;">72</span>                  e.close();
<span style="color: #804040;">73</span>          }<span style="color: #0000ff;">//run()</span>
<span style="color: #804040;">74</span>  }</pre>
<hr />And here&#8217;s the simple javabean data container&#8230;</p>
<pre><span style="color: #804040;"> 1</span>  <span style="color: #a020f0;">import</span> java.util.ArrayList;
<span style="color: #804040;"> 2</span>  <span style="color: #a020f0;">import</span> java.util.List;
<span style="color: #804040;"> 3</span>
<span style="color: #804040;"> 4</span>  <span style="color: #2e8b57;"><strong>public</strong></span> <span style="color: #2e8b57;"><strong>class</strong></span> SimpleBean {
<span style="color: #804040;"> 5</span>          <span style="color: #2e8b57;"><strong>private</strong></span> <span style="color: #2e8b57;"><strong>int</strong></span> age;
<span style="color: #804040;"> 6</span>          <span style="color: #2e8b57;"><strong>private</strong></span> String name;
<span style="color: #804040;"> 7</span>          <span style="color: #2e8b57;"><strong>private</strong></span> List favorite;
<span style="color: #804040;"> 8</span>
<span style="color: #804040;"> 9</span>          <span style="color: #2e8b57;"><strong>public</strong></span> SimpleBean() {
<span style="color: #804040;">10</span>                  age=<span style="color: #ff00ff;">0</span>;
<span style="color: #804040;">11</span>                  name=<span style="color: #ff00ff;">""</span>;
<span style="color: #804040;">12</span>                  favorite=<span style="color: #804040;"><strong>new</strong></span> ArrayList();
<span style="color: #804040;">13</span>          }
<span style="color: #804040;">14</span>
<span style="color: #804040;">15</span>          <span style="color: #2e8b57;"><strong>public</strong></span> <span style="color: #2e8b57;"><strong>int</strong></span> getAge() {
<span style="color: #804040;">16</span>                  <span style="color: #804040;"><strong>return</strong></span> age;
<span style="color: #804040;">17</span>          }
<span style="color: #804040;">18</span>          <span style="color: #2e8b57;"><strong>public</strong></span> <span style="color: #2e8b57;"><strong>void</strong></span> setAge(<span style="color: #2e8b57;"><strong>int</strong></span> age) {
<span style="color: #804040;">19</span>                  <span style="color: #2e8b57;"><strong>this</strong></span>.age = age;
<span style="color: #804040;">20</span>          }
<span style="color: #804040;">21</span>          <span style="color: #2e8b57;"><strong>public</strong></span> List getFavorite() {
<span style="color: #804040;">22</span>                  <span style="color: #804040;"><strong>return</strong></span> favorite;
<span style="color: #804040;">23</span>          }
<span style="color: #804040;">24</span>          <span style="color: #2e8b57;"><strong>public</strong></span> <span style="color: #2e8b57;"><strong>void</strong></span> setFavorite(List favorite) {
<span style="color: #804040;">25</span>                  <span style="color: #2e8b57;"><strong>this</strong></span>.favorite = favorite;
<span style="color: #804040;">26</span>          }
<span style="color: #804040;">27</span>          <span style="color: #2e8b57;"><strong>public</strong></span> String getName() {
<span style="color: #804040;">28</span>                  <span style="color: #804040;"><strong>return</strong></span> name;
<span style="color: #804040;">29</span>          }
<span style="color: #804040;">30</span>          <span style="color: #2e8b57;"><strong>public</strong></span> <span style="color: #2e8b57;"><strong>void</strong></span> setName(String name) {
<span style="color: #804040;">31</span>                  <span style="color: #2e8b57;"><strong>this</strong></span>.name = name;
<span style="color: #804040;">32</span>          }
<span style="color: #804040;">33</span>          <span style="color: #2e8b57;"><strong>public</strong></span> <span style="color: #2e8b57;"><strong>void</strong></span> addFavorite(Object arg1) {
<span style="color: #804040;">34</span>                  favorite.add(arg1);
<span style="color: #804040;">35</span>          }
<span style="color: #804040;">36</span>  }</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.mattpayne.org/blog/2006/06/25/xmlencoder-and-xmldecoder-reminder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>No Doubt!  Apache&#8217;s XML Security will encrypt subtrees!</title>
		<link>http://www.mattpayne.org/blog/2006/06/23/no-doubt-apaches-xml-security-will-encrypt-subtrees/</link>
		<comments>http://www.mattpayne.org/blog/2006/06/23/no-doubt-apaches-xml-security-will-encrypt-subtrees/#comments</comments>
		<pubDate>Fri, 23 Jun 2006 21:55:08 +0000</pubDate>
		<dc:creator>Payne</dc:creator>
				<category><![CDATA[Crypto]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.mattpayne.org/blog/2006/06/23/no-doubt-apaches-xml-security-will-encrypt-subtrees/</guid>
		<description><![CDATA[Original post 10 May 2004.  TODO: Still need to update the before and
after samples&#8230;
It was easy to hack the org.apache.xml.security.samples.encryption.Encrypter
demo to show that just a subtree of a document could be encrypted&#8230;.
before
after
  1  /*
  2   * Copyright  1999-2004 The Apache Software Foundation.
  3   *
  [...]]]></description>
			<content:encoded><![CDATA[<p>Original post 10 May 2004.  TODO: Still need to update the before and<br />
after samples&#8230;</p>
<p>It was easy to hack the org.apache.xml.security.samples.encryption.Encrypter<br />
demo to show that just a subtree of a document could be encrypted&#8230;.<br />
<a href="http://MattPayne.org/java/crypto/xmlenc2/before.xml">before</a><br />
<a href="http://MattPayne.org/java/crypto/xmlenc2/after.xml">after</a></p>
<pre><span style="color: #a52a2a;">  1</span>  <span style="color: #0000ff;">/*</span>
<span style="color: #a52a2a;">  2</span>  <span style="color: #0000ff;"> * Copyright  1999-2004 The Apache Software Foundation.</span>
<span style="color: #a52a2a;">  3</span>  <span style="color: #0000ff;"> *</span>
<span style="color: #a52a2a;">  4</span>  <span style="color: #0000ff;"> *  Licensed under the Apache License, Version 2.0 (the "License");</span>
<span style="color: #a52a2a;">  5</span>  <span style="color: #0000ff;"> *  you may not use this file except in compliance with the License.</span>
<span style="color: #a52a2a;">  6</span>  <span style="color: #0000ff;"> *  You may obtain a copy of the License at</span>
<span style="color: #a52a2a;">  7</span>  <span style="color: #0000ff;"> *</span>
<span style="color: #a52a2a;">  8</span>  <span style="color: #0000ff;"> *      http://www.apache.org/licenses/LICENSE-2.0</span>
<span style="color: #a52a2a;">  9</span>  <span style="color: #0000ff;"> *</span>
<span style="color: #a52a2a;"> 10</span>  <span style="color: #0000ff;"> *  Unless required by applicable law or agreed to in writing, software</span>
<span style="color: #a52a2a;"> 11</span>  <span style="color: #0000ff;"> *  distributed under the License is distributed on an "AS IS" BASIS,</span>
<span style="color: #a52a2a;"> 12</span>  <span style="color: #0000ff;"> *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
<span style="color: #a52a2a;"> 13</span>  <span style="color: #0000ff;"> *  See the License for the specific language governing permissions and</span>
<span style="color: #a52a2a;"> 14</span>  <span style="color: #0000ff;"> *  limitations under the License.</span>
<span style="color: #a52a2a;"> 15</span>  <span style="color: #0000ff;"> *</span>
<span style="color: #a52a2a;"> 16</span>  <span style="color: #0000ff;"> */</span>
<span style="color: #a52a2a;"> 17</span>  <span style="color: #a020f0;">package</span> org.apache.xml.security.samples.encryption;
<span style="color: #a52a2a;"> 18</span>
<span style="color: #a52a2a;"> 19</span>
<span style="color: #a52a2a;"> 20</span>  <span style="color: #a020f0;">import</span> java.io.File;
<span style="color: #a52a2a;"> 21</span>  <span style="color: #a020f0;">import</span> java.io.FileInputStream;
<span style="color: #a52a2a;"> 22</span>  <span style="color: #a020f0;">import</span> java.io.FileOutputStream;
<span style="color: #a52a2a;"> 23</span>
<span style="color: #a52a2a;"> 24</span>  <span style="color: #a020f0;">import</span> java.security.Key;
<span style="color: #a52a2a;"> 25</span>
<span style="color: #a52a2a;"> 26</span>  <span style="color: #a020f0;">import</span> javax.crypto.SecretKey;
<span style="color: #a52a2a;"> 27</span>  <span style="color: #a020f0;">import</span> javax.crypto.KeyGenerator;
<span style="color: #a52a2a;"> 28</span>
<span style="color: #a52a2a;"> 29</span>  <span style="color: #a020f0;">import</span> org.apache.xml.security.keys.KeyInfo;
<span style="color: #a52a2a;"> 30</span>  <span style="color: #a020f0;">import</span> org.apache.xml.security.encryption.XMLCipher;
<span style="color: #a52a2a;"> 31</span>  <span style="color: #a020f0;">import</span> org.apache.xml.security.encryption.EncryptedData;
<span style="color: #a52a2a;"> 32</span>  <span style="color: #a020f0;">import</span> org.apache.xml.security.encryption.EncryptedKey;
<span style="color: #a52a2a;"> 33</span>  <span style="color: #a020f0;">import</span> org.apache.xml.security.utils.XMLUtils;
<span style="color: #a52a2a;"> 34</span>  <span style="color: #a020f0;">import</span> org.apache.xml.security.utils.Constants;
<span style="color: #a52a2a;"> 35</span>
<span style="color: #a52a2a;"> 36</span>  <span style="color: #a020f0;">import</span> org.w3c.dom.Document;
<span style="color: #a52a2a;"> 37</span>  <span style="color: #a020f0;">import</span> org.w3c.dom.Element;
<span style="color: #a52a2a;"> 38</span>  <span style="color: #a020f0;">import</span> org.w3c.dom.NodeList;
<span style="color: #a52a2a;"> 39</span>
<span style="color: #a52a2a;"> 40</span>  <span style="color: #a020f0;">import</span> javax.xml.transform.TransformerFactory;
<span style="color: #a52a2a;"> 41</span>  <span style="color: #a020f0;">import</span> javax.xml.transform.Transformer;
<span style="color: #a52a2a;"> 42</span>  <span style="color: #a020f0;">import</span> javax.xml.transform.dom.DOMSource;
<span style="color: #a52a2a;"> 43</span>  <span style="color: #a020f0;">import</span> javax.xml.transform.stream.StreamResult;
<span style="color: #a52a2a;"> 44</span>  <span style="color: #a020f0;">import</span> javax.xml.transform.OutputKeys;
<span style="color: #a52a2a;"> 45</span>
<span style="color: #a52a2a;"> 46</span>  <span style="color: #0000ff;">/**</span>
<span style="color: #a52a2a;"> 47</span>  <span style="color: #0000ff;"> *</span><span style="color: #6a5acd;"> This sample demonstrates how to encrypt data inside an xml document.</span>
<span style="color: #a52a2a;"> 48</span>  <span style="color: #0000ff;"> *</span>
<span style="color: #a52a2a;"> 49</span>  <span style="color: #0000ff;"> * </span><span style="color: #6a5acd;">@author</span><span style="color: #0000ff;"> Vishal Mahajan (Sun Microsystems)</span>
<span style="color: #a52a2a;"> 50</span>  <span style="color: #0000ff;"> * Hacked by Matt</span>
<span style="color: #a52a2a;"> 51</span>  <span style="color: #0000ff;"> */</span>
<span style="color: #a52a2a;"> 52</span>  <span style="color: #2e8b57;"><strong>public</strong></span> <span style="color: #2e8b57;"><strong>class</strong></span> Encrypter2 {
<span style="color: #a52a2a;"> 53</span>
<span style="color: #a52a2a;"> 54</span>      <span style="color: #0000ff;">/**</span><span style="color: #6a5acd;"> {</span><span style="color: #0000ff;">@link org.apache.commons.logging} logging facility */</span>
<span style="color: #a52a2a;"> 55</span>      <span style="color: #2e8b57;"><strong>static</strong></span> org.apache.commons.logging.Log log =
<span style="color: #a52a2a;"> 56</span>          org.apache.commons.logging.LogFactory.getLog(
<span style="color: #a52a2a;"> 57</span>              Encrypter2.<span style="color: #2e8b57;"><strong>class</strong></span>.getName());
<span style="color: #a52a2a;"> 58</span>
<span style="color: #a52a2a;"> 59</span>      <span style="color: #2e8b57;"><strong>static</strong></span> {
<span style="color: #a52a2a;"> 60</span>          org.apache.xml.security.Init.init();
<span style="color: #a52a2a;"> 61</span>      }
<span style="color: #a52a2a;"> 62</span>
<span style="color: #a52a2a;"> 63</span>      <span style="color: #2e8b57;"><strong>private</strong></span> <span style="color: #2e8b57;"><strong>static</strong></span> Document createSampleDocument() <span style="color: #2e8b57;"><strong>throws</strong></span> Exception {
<span style="color: #a52a2a;"> 64</span>
<span style="color: #a52a2a;"> 65</span>          javax.xml.parsers.DocumentBuilderFactory dbf =
<span style="color: #a52a2a;"> 66</span>              javax.xml.parsers.DocumentBuilderFactory.newInstance();
<span style="color: #a52a2a;"> 67</span>          dbf.setNamespaceAware(<span style="color: #ff00ff;">true</span>);
<span style="color: #a52a2a;"> 68</span>          javax.xml.parsers.DocumentBuilder db = dbf.newDocumentBuilder();
<span style="color: #a52a2a;"> 69</span>          Document document = db.newDocument();
<span style="color: #a52a2a;"> 70</span>
<span style="color: #a52a2a;"> 71</span>          <span style="color: #0000ff;">/**</span>
<span style="color: #a52a2a;"> 72</span>  <span style="color: #0000ff;">         *</span><span style="color: #6a5acd;"> Build a sample document.</span><span style="color: #0000ff;"> It will look something like:</span>
<span style="color: #a52a2a;"> 73</span>  <span style="color: #0000ff;">         *</span>
<span style="color: #a52a2a;"> 74</span>  <span style="color: #0000ff;">         * </span><span style="color: #008b8b;">&lt;</span>apache<span style="color: #008b8b;">:RootElement xmlns:apache=</span><span style="color: #ff00ff;">"http://www.apache.org/ns/#app1"</span><span style="color: #008b8b;">&gt;</span>
<span style="color: #a52a2a;"> 75</span>  <span style="color: #0000ff;">         * </span><span style="color: #008b8b;">&lt;</span>apache<span style="color: #008b8b;">:foo&gt;</span><span style="color: #0000ff;">Some simple text</span><span style="color: #008b8b;">&lt;/</span>apache<span style="color: #008b8b;">:foo&gt;</span>
<span style="color: #a52a2a;"> 76</span>  <span style="color: #0000ff;">         * </span><span style="color: #008b8b;">&lt;/</span>apache<span style="color: #008b8b;">:RootElement&gt;</span>
<span style="color: #a52a2a;"> 77</span>  <span style="color: #0000ff;">         */</span>
<span style="color: #a52a2a;"> 78</span>          Element root =
<span style="color: #a52a2a;"> 79</span>              document.createElementNS(
<span style="color: #a52a2a;"> 80</span>                  <span style="color: #ff00ff;">"http://www.apache.org/ns/#app1"</span>, <span style="color: #ff00ff;">"apache:RootElement"</span>);
<span style="color: #a52a2a;"> 81</span>          root.setAttributeNS(
<span style="color: #a52a2a;"> 82</span>              Constants.NamespaceSpecNS,
<span style="color: #a52a2a;"> 83</span>              <span style="color: #ff00ff;">"xmlns:apache"</span>,
<span style="color: #a52a2a;"> 84</span>              <span style="color: #ff00ff;">"http://www.apache.org/ns/#app1"</span>);
<span style="color: #a52a2a;"> 85</span>          document.appendChild(root);
<span style="color: #a52a2a;"> 86</span>
<span style="color: #a52a2a;"> 87</span>          root.appendChild(document.createTextNode(<span style="color: #ff00ff;">"</span><span style="color: #6a5acd;">\n</span><span style="color: #ff00ff;">"</span>));
<span style="color: #a52a2a;"> 88</span>
<span style="color: #a52a2a;"> 89</span>          Element childElement =
<span style="color: #a52a2a;"> 90</span>              document.createElementNS(
<span style="color: #a52a2a;"> 91</span>                  <span style="color: #ff00ff;">"http://www.apache.org/ns/#app1"</span>, <span style="color: #ff00ff;">"apache:foo"</span>);
<span style="color: #a52a2a;"> 92</span>          childElement.appendChild(
<span style="color: #a52a2a;"> 93</span>              document.createTextNode(<span style="color: #ff00ff;">"Some simple text"</span>));
<span style="color: #a52a2a;"> 94</span>
<span style="color: #a52a2a;"> 95</span>          Element e2 = document.createElementNS(
<span style="color: #a52a2a;"> 96</span>                  <span style="color: #ff00ff;">"http://www.apache.org/ns/#app1"</span>, <span style="color: #ff00ff;">"apache:goo"</span>);
<span style="color: #a52a2a;"> 97</span>                  e2.appendChild(document.createTextNode(<span style="color: #ff00ff;">"Weather Report"</span>));
<span style="color: #a52a2a;"> 98</span>
<span style="color: #a52a2a;"> 99</span>                  Element e3 = document.createElementNS(
<span style="color: #a52a2a;">100</span>                  <span style="color: #ff00ff;">"http://www.apache.org/ns/#app1"</span>, <span style="color: #ff00ff;">"apache:bar"</span>);
<span style="color: #a52a2a;">101</span>                  e3.appendChild(document.createTextNode(<span style="color: #ff00ff;">"No Doubt"</span>));
<span style="color: #a52a2a;">102</span>
<span style="color: #a52a2a;">103</span>                  e2.appendChild(e3);
<span style="color: #a52a2a;">104</span>
<span style="color: #a52a2a;">105</span>                  e2.appendChild( e3.appendChild(document.createTextNode(<span style="color: #ff00ff;">"biteme"</span>)));
<span style="color: #a52a2a;">106</span>
<span style="color: #a52a2a;">107</span>          childElement.appendChild(e2);
<span style="color: #a52a2a;">108</span>
<span style="color: #a52a2a;">109</span>
<span style="color: #a52a2a;">110</span>          root.appendChild(childElement);
<span style="color: #a52a2a;">111</span>
<span style="color: #a52a2a;">112</span>          root.appendChild(document.createTextNode(<span style="color: #ff00ff;">"</span><span style="color: #6a5acd;">\n</span><span style="color: #ff00ff;">"</span>));
<span style="color: #a52a2a;">113</span>
<span style="color: #a52a2a;">114</span>
<span style="color: #a52a2a;">115</span>          outputDocToFile(document, <span style="color: #ff00ff;">"before2.xml"</span>);
<span style="color: #a52a2a;">116</span>
<span style="color: #a52a2a;">117</span>          <span style="color: #a52a2a;"><strong>return</strong></span> document;
<span style="color: #a52a2a;">118</span>      }
<span style="color: #a52a2a;">119</span>
<span style="color: #a52a2a;">120</span>      <span style="color: #2e8b57;"><strong>private</strong></span> <span style="color: #2e8b57;"><strong>static</strong></span> SecretKey GenerateAndStoreKeyEncryptionKey()
<span style="color: #a52a2a;">121</span>          <span style="color: #2e8b57;"><strong>throws</strong></span> Exception {
<span style="color: #a52a2a;">122</span>
<span style="color: #a52a2a;">123</span>          String jceAlgorithmName = <span style="color: #ff00ff;">"DESede"</span>;
<span style="color: #a52a2a;">124</span>          KeyGenerator keyGenerator =
<span style="color: #a52a2a;">125</span>              KeyGenerator.getInstance(jceAlgorithmName);
<span style="color: #a52a2a;">126</span>          SecretKey kek = keyGenerator.generateKey();
<span style="color: #a52a2a;">127</span>
<span style="color: #a52a2a;">128</span>          <span style="color: #2e8b57;"><strong>byte</strong></span>[] keyBytes = kek.getEncoded();
<span style="color: #a52a2a;">129</span>          File kekFile = <span style="color: #a52a2a;"><strong>new</strong></span> File(<span style="color: #ff00ff;">"kek"</span>);
<span style="color: #a52a2a;">130</span>          FileOutputStream f = <span style="color: #a52a2a;"><strong>new</strong></span> FileOutputStream(kekFile);
<span style="color: #a52a2a;">131</span>          f.write(keyBytes);
<span style="color: #a52a2a;">132</span>          f.close();
<span style="color: #a52a2a;">133</span>          System.out.println(
<span style="color: #a52a2a;">134</span>              <span style="color: #ff00ff;">"Key encryption key stored in "</span> + kekFile.toURL().toString());
<span style="color: #a52a2a;">135</span>
<span style="color: #a52a2a;">136</span>          <span style="color: #a52a2a;"><strong>return</strong></span> kek;
<span style="color: #a52a2a;">137</span>      }
<span style="color: #a52a2a;">138</span>
<span style="color: #a52a2a;">139</span>      <span style="color: #2e8b57;"><strong>private</strong></span> <span style="color: #2e8b57;"><strong>static</strong></span> SecretKey GenerateDataEncryptionKey() <span style="color: #2e8b57;"><strong>throws</strong></span> Exception {
<span style="color: #a52a2a;">140</span>
<span style="color: #a52a2a;">141</span>          String jceAlgorithmName = <span style="color: #ff00ff;">"AES"</span>;
<span style="color: #a52a2a;">142</span>          KeyGenerator keyGenerator =
<span style="color: #a52a2a;">143</span>              KeyGenerator.getInstance(jceAlgorithmName);
<span style="color: #a52a2a;">144</span>          keyGenerator.init(<span style="color: #ff00ff;">128</span>);
<span style="color: #a52a2a;">145</span>          <span style="color: #a52a2a;"><strong>return</strong></span> keyGenerator.generateKey();
<span style="color: #a52a2a;">146</span>      }
<span style="color: #a52a2a;">147</span>
<span style="color: #a52a2a;">148</span>      <span style="color: #2e8b57;"><strong>private</strong></span> <span style="color: #2e8b57;"><strong>static</strong></span> <span style="color: #2e8b57;"><strong>void</strong></span> outputDocToFile(Document doc, String fileName)
<span style="color: #a52a2a;">149</span>          <span style="color: #2e8b57;"><strong>throws</strong></span> Exception {
<span style="color: #a52a2a;">150</span>          File encryptionFile = <span style="color: #a52a2a;"><strong>new</strong></span> File(fileName);
<span style="color: #a52a2a;">151</span>          FileOutputStream f = <span style="color: #a52a2a;"><strong>new</strong></span> FileOutputStream(encryptionFile);
<span style="color: #a52a2a;">152</span>
<span style="color: #a52a2a;">153</span>          TransformerFactory factory = TransformerFactory.newInstance();
<span style="color: #a52a2a;">154</span>          Transformer transformer = factory.newTransformer();
<span style="color: #a52a2a;">155</span>          transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, <span style="color: #ff00ff;">"yes"</span>);
<span style="color: #a52a2a;">156</span>          DOMSource source = <span style="color: #a52a2a;"><strong>new</strong></span> DOMSource(doc);
<span style="color: #a52a2a;">157</span>          StreamResult result = <span style="color: #a52a2a;"><strong>new</strong></span> StreamResult(f);
<span style="color: #a52a2a;">158</span>          transformer.transform(source, result);
<span style="color: #a52a2a;">159</span>
<span style="color: #a52a2a;">160</span>          f.close();
<span style="color: #a52a2a;">161</span>          System.out.println(
<span style="color: #a52a2a;">162</span>              <span style="color: #ff00ff;">"Wrote document containing encrypted data to "</span> +
<span style="color: #a52a2a;">163</span>              encryptionFile.toURL().toString());
<span style="color: #a52a2a;">164</span>      }
<span style="color: #a52a2a;">165</span>
<span style="color: #a52a2a;">166</span>      <span style="color: #2e8b57;"><strong>public</strong></span> <span style="color: #2e8b57;"><strong>static</strong></span> <span style="color: #2e8b57;"><strong>void</strong></span> main(String unused[]) <span style="color: #2e8b57;"><strong>throws</strong></span> Exception {
<span style="color: #a52a2a;">167</span>
<span style="color: #a52a2a;">168</span>          Document document = createSampleDocument();
<span style="color: #a52a2a;">169</span>
<span style="color: #a52a2a;">170</span>          <span style="color: #0000ff;">/*</span>
<span style="color: #a52a2a;">171</span>  <span style="color: #0000ff;">         * Get a key to be used for encrypting the element.</span>
<span style="color: #a52a2a;">172</span>  <span style="color: #0000ff;">         * Here we are generating an AES key.</span>
<span style="color: #a52a2a;">173</span>  <span style="color: #0000ff;">         */</span>
<span style="color: #a52a2a;">174</span>          Key symmetricKey = GenerateDataEncryptionKey();
<span style="color: #a52a2a;">175</span>
<span style="color: #a52a2a;">176</span>          <span style="color: #0000ff;">/*</span>
<span style="color: #a52a2a;">177</span>  <span style="color: #0000ff;">         * Get a key to be used for encrypting the symmetric key.</span>
<span style="color: #a52a2a;">178</span>  <span style="color: #0000ff;">         * Here we are generating a DESede key.</span>
<span style="color: #a52a2a;">179</span>  <span style="color: #0000ff;">         */</span>
<span style="color: #a52a2a;">180</span>          Key kek = GenerateAndStoreKeyEncryptionKey();
<span style="color: #a52a2a;">181</span>
<span style="color: #a52a2a;">182</span>          String algorithmURI = XMLCipher.TRIPLEDES_KeyWrap;
<span style="color: #a52a2a;">183</span>
<span style="color: #a52a2a;">184</span>          XMLCipher keyCipher =
<span style="color: #a52a2a;">185</span>              XMLCipher.getInstance(algorithmURI);
<span style="color: #a52a2a;">186</span>          keyCipher.init(XMLCipher.WRAP_MODE, kek);
<span style="color: #a52a2a;">187</span>          EncryptedKey encryptedKey =
<span style="color: #a52a2a;">188</span>              keyCipher.encryptKey(document, symmetricKey);
<span style="color: #a52a2a;">189</span>
<span style="color: #a52a2a;">190</span>          <span style="color: #0000ff;">/*</span>
<span style="color: #a52a2a;">191</span>  <span style="color: #0000ff;">         * Let us encrypt the contents of the document element.</span>
<span style="color: #a52a2a;">192</span>  <span style="color: #0000ff;">         */</span>
<span style="color: #a52a2a;">193</span>          Element rootElement = document.getDocumentElement();
<span style="color: #a52a2a;">194</span>          NodeList node =  rootElement.getElementsByTagName(<span style="color: #ff00ff;">"apache:bar"</span>);
<span style="color: #a52a2a;">195</span>          rootElement = (Element) node.item(<span style="color: #ff00ff;">0</span>);
<span style="color: #a52a2a;">196</span>          System.out.println(<span style="color: #ff00ff;">"node="</span>+node);
<span style="color: #a52a2a;">197</span>         <span style="color: #0000ff;">// rootElement = (Element)</span>
<span style="color: #a52a2a;">198</span>                  System.out.println(<span style="color: #ff00ff;">"rootElement="</span>+rootElement);
<span style="color: #a52a2a;">199</span>          <span style="color: #0000ff;">//rootElement = (Element) rootElement.getFirstChild().getFirstChild();</span>
<span style="color: #a52a2a;">200</span>
<span style="color: #a52a2a;">201</span>          algorithmURI = XMLCipher.AES_128;
<span style="color: #a52a2a;">202</span>
<span style="color: #a52a2a;">203</span>          XMLCipher xmlCipher =
<span style="color: #a52a2a;">204</span>              XMLCipher.getInstance(algorithmURI);
<span style="color: #a52a2a;">205</span>          xmlCipher.init(XMLCipher.ENCRYPT_MODE, symmetricKey);
<span style="color: #a52a2a;">206</span>
<span style="color: #a52a2a;">207</span>          <span style="color: #0000ff;">/*</span>
<span style="color: #a52a2a;">208</span>  <span style="color: #0000ff;">         * Setting keyinfo inside the encrypted data being prepared.</span>
<span style="color: #a52a2a;">209</span>  <span style="color: #0000ff;">         */</span>
<span style="color: #a52a2a;">210</span>          EncryptedData encryptedData = xmlCipher.getEncryptedData();
<span style="color: #a52a2a;">211</span>          KeyInfo keyInfo = <span style="color: #a52a2a;"><strong>new</strong></span> KeyInfo(document);
<span style="color: #a52a2a;">212</span>          keyInfo.add(encryptedKey);
<span style="color: #a52a2a;">213</span>          encryptedData.setKeyInfo(keyInfo);
<span style="color: #a52a2a;">214</span>
<span style="color: #a52a2a;">215</span>          <span style="color: #0000ff;">/*</span>
<span style="color: #a52a2a;">216</span>  <span style="color: #0000ff;">         * doFinal -</span>
<span style="color: #a52a2a;">217</span>  <span style="color: #0000ff;">         * "true" below indicates that we want to encrypt element's content</span>
<span style="color: #a52a2a;">218</span>  <span style="color: #0000ff;">         * and not the element itself. Also, the doFinal method would</span>
<span style="color: #a52a2a;">219</span>  <span style="color: #0000ff;">         * modify the document by replacing the EncrypteData element</span>
<span style="color: #a52a2a;">220</span>  <span style="color: #0000ff;">         * for the data to be encrypted.</span>
<span style="color: #a52a2a;">221</span>  <span style="color: #0000ff;">         */</span>
<span style="color: #a52a2a;">222</span>          xmlCipher.doFinal(document, rootElement, <span style="color: #ff00ff;">true</span>);
<span style="color: #a52a2a;">223</span>
<span style="color: #a52a2a;">224</span>          <span style="color: #0000ff;">/*</span>
<span style="color: #a52a2a;">225</span>  <span style="color: #0000ff;">         * Output the document containing the encrypted information into</span>
<span style="color: #a52a2a;">226</span>  <span style="color: #0000ff;">         * a file.</span>
<span style="color: #a52a2a;">227</span>  <span style="color: #0000ff;">         */</span>
<span style="color: #a52a2a;">228</span>          outputDocToFile(document, <span style="color: #ff00ff;">"encryptedInfo2.xml"</span>);
<span style="color: #a52a2a;">229</span>      }
<span style="color: #a52a2a;">230</span>  }</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.mattpayne.org/blog/2006/06/23/no-doubt-apaches-xml-security-will-encrypt-subtrees/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>implementors plugin for eclipse</title>
		<link>http://www.mattpayne.org/blog/2006/06/20/implementors-plugin-for-eclipse/</link>
		<comments>http://www.mattpayne.org/blog/2006/06/20/implementors-plugin-for-eclipse/#comments</comments>
		<pubDate>Tue, 20 Jun 2006 19:33:53 +0000</pubDate>
		<dc:creator>Payne</dc:creator>
				<category><![CDATA[eclipse]]></category>

		<guid isPermaLink="false">http://www.mattpayne.org/blog/2006/06/20/implementors-plugin-for-eclipse/</guid>
		<description><![CDATA[Many thanks to Matt Secoske for telling about the implementors plugin for eclipse!
Now when &#8220;coding to the interface&#8221; I no longer have to be frustrated by not being able to easily walk my code in eclipse!
From http://eclipse-tools.sourceforge.net/implementors/usage.html:
Activating the Open Implementation action is done by pressing Alt+F3 in the Java editor      [...]]]></description>
			<content:encoded><![CDATA[<p>Many thanks to <a rel="friend met neighbor" href="http://www.secosoft.net/">Matt Secoske</a> for telling about the implementors plugin for eclipse!</p>
<p>Now when &#8220;coding to the interface&#8221; I no longer have to be frustrated by not being able to easily walk my code in eclipse!</p>
<p>From <a href="http://eclipse-tools.sourceforge.net/implementors/usage.html">http://eclipse-tools.sourceforge.net/implementors/usage.html</a>:</p>
<blockquote><p>Activating the Open Implementation action is done by pressing Alt+F3 in the Java editor             (this shortcut may be customized in the preferences.)             The plugin may also be activated in the editor&#8217;s context menu (the name of the action is &#8220;Open Implementation&#8221;.)</p>
<p>If the cursor is located on a method name, Eclipse jumps to the implementing method(s). If the cursor is located on             a an interface type (either the type itself or an instance), Eclipse jumps to the implementing type(s).</p>
<p>If no matching classes are found, a message is shown in the status line.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.mattpayne.org/blog/2006/06/20/implementors-plugin-for-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>javadocbook utility</title>
		<link>http://www.mattpayne.org/blog/2006/06/08/javadocbook-utility/</link>
		<comments>http://www.mattpayne.org/blog/2006/06/08/javadocbook-utility/#comments</comments>
		<pubDate>Thu, 08 Jun 2006 21:27:43 +0000</pubDate>
		<dc:creator>Payne</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.mattpayne.org/blog/2006/06/08/javadocbook-utility/</guid>
		<description><![CDATA[https://sourceforge.net/projects/javadocbook/ looks nice!
java -jar javadocbook.jar -t HTML hw.xml  &#62; hw.html
changes some docbook into some HTML.     It&#8217;s nice because it&#8217;s so self contained&#8230;
http://mattpayne.org/db/hw.xml is some input taken from this tutorial.   Results in the output http://mattpayne.org/db/hw.html
Maven2 understands simplified docbook.  Maybe the javadocbook utility can be handy for someone using [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://sourceforge.net/projects/javadocbook/">https://sourceforge.net/projects/javadocbook/</a> looks nice!</p>
<p><strong>java -jar javadocbook.jar -t HTML hw.xml  &gt; hw.html</strong><br />
changes some docbook into some HTML.     It&#8217;s nice because it&#8217;s so self contained&#8230;</p>
<p><a href="http://mattpayne.org/db/hw.xml">http://mattpayne.org/db/hw.xml</a> is some input taken from <a href="http://www.galassi.org/mark//mydocs/docbook-intro/get-going.html#HELLO-WORLD">this tutorial</a>.   Results in the output <a href="http://mattpayne.org/db/hw.html">http://mattpayne.org/db/hw.html</a></p>
<p>Maven2 understands simplified docbook.  Maybe the javadocbook utility can be handy for someone using maven2 for their projects?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattpayne.org/blog/2006/06/08/javadocbook-utility/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Java Web Start Quick Start</title>
		<link>http://www.mattpayne.org/blog/2005/03/13/java-web-start-quick-start/</link>
		<comments>http://www.mattpayne.org/blog/2005/03/13/java-web-start-quick-start/#comments</comments>
		<pubDate>Mon, 14 Mar 2005 03:18:14 +0000</pubDate>
		<dc:creator>Payne</dc:creator>
				<category><![CDATA[JNLP]]></category>
		<category><![CDATA[Notes]]></category>

		<guid isPermaLink="false">http://www.mattpayne.org/blog/2005/03/13/java-web-start-quick-start/</guid>
		<description><![CDATA[This is still draft -- transitioning to wordpress....

All the files associated with this page are here: demo.zip.

Java Web Start installs as part of standard java these days. There are lots of applications available as java web start applications. Any java program that can be launched using the command "java -jar someapp.jar" can be java web [...]]]></description>
			<content:encoded><![CDATA[This is still draft -- transitioning to wordpress....

<a href="http://www.mattpayne.org/blog/demo.zip">All the files associated with this page are here: demo.zip.</a>

<a href="http://www.mattpayne.org/blog/demo.zip"></a><a href="http://java.sun.com/products/javawebstart">Java Web Start installs as part of standard java these days. There are </a><a href="http://openjnlp.nanode.org/app-list.html">lots of applications</a> available as java web start applications. Any java program that can be launched using the command "java -jar someapp.jar" can be java web started. Also, if you're double clicking on a jar to run the program you can java web start it. There are several advantages to doing this:
<ol>
	<li>Java Web Start always checks for the latest version of your program.</li>
	<li>If you want to keep the old version, just create a new URL.  The programs are versioned per URL.</li>
	<li>The program is only downloaded to the client computer once. After that, startup is very fast. You can even have the program run offline.</li>
</ol>
Try the <a href="http://www.mattpayne.org/blog/demo.php">java web start</a> of this <a href="http://www.mattpayne.org/blog/edu/unomaha/demo/Demo.java">simple application</a>.

Java web start runs by sending the <strong>application/x-java-jnlp-file</strong> mime type to the browser. The browser then starts the local java web start manager (that was installed as part of standard java); the java web start manager reads the JNLP file (java network launching protocol) and uses this information to download and start the application.
<h3>Sending the MIME type to the browser</h3>
<a href="http://webstartfaq.com/">http://webstartfaq.com/</a> search for htaccess. There are two tips there: one setting a .htaccess file and the other mixing in a little PHP into the JNLP file. Below is the PHP script I've had luck with.
<pre><span style="color: #a52929;">1</span>  <span style="color: #6b5ace;"> <span style="color: #a52929;">2</span>  <span style="color: #008c8c;">header</span><span style="color: #6b5ace;">(</span>'<span style="color: #ff00ff;">Content-Type: application/x-java-jnlp-file</span>'<span style="color: #6b5ace;">)</span>; <span style="color: #a52929;">3</span>  <span style="color: #a52929;"><strong>$</strong></span><span style="color: #008c8c;">fn</span><span style="color: #a52929;"><strong>=</strong></span>'<span style="color: #ff00ff;">/home/payne/public_html/demo/demo.jnlp</span>'; <span style="color: #a52929;">4</span>  <span style="color: #008c8c;">fpassthru</span><span style="color: #6b5ace;">(</span><span style="color: #008c8c;">fopen</span><span style="color: #6b5ace;">(</span><span style="color: #a52929;"><strong>$</strong></span><span style="color: #008c8c;">fn</span>,'<span style="color: #ff00ff;">r</span>'<span style="color: #6b5ace;">))</span>; <span style="color: #a52929;">5</span>  <span style="color: #6b5ace;">?&gt;</span> </span></pre>
<span style="color: #6b5ace;"> </span>
<h3><span style="color: #6b5ace;">The JNLP file</span></h3>
<span style="color: #6b5ace;"> </span><span style="color: #6b5ace;">The next step is to adjust the JNLP (java native launching protocol) file. (<a href="http://www.mattpayne.org/blog/demo.jnlp">here's a copy of the file below (hint use wget)</a>) Here's the breakdown of the line numbers: </span>
<ul>

<span style="color: #6b5ace;">
	<li><span style="color: #6b5ace;">4 - the url that this is coming from</span></li>
	<li><span style="color: #6b5ace;">5 - the name of this jnlp file</span></li>
	<li><span style="color: #6b5ace;">7,8,and 9 are free text set them to anything you like</span></li>
	<li><span style="color: #6b5ace;">15 - names the jar with your .class files and other goodies in it. Don't forget that you can read images, properties files, and other stuff directly from a jar. You can have multiple jar tags if you have lots of library jars.</span></li>
	<li><span style="color: #6b5ace;">17 - Names the full name of the class to run</span></li>
	<li><span style="color: #6b5ace;">18 - Use this if you want your app to have all the privs of someone typing <strong>java -jar demo.jar</strong>; this requires signing the jar file.</span></li>
</span></ul>
<span style="color: #6b5ace;"><span style="color: #6b5ace;"> </span></span>
<pre><span style="color: #6b5ace;"><span style="color: #6b5ace;"><span style="color: #a52929;"> 1</span>  <span style="color: #0000ff;"><span style="color: #298c52;"><strong>xml</strong></span><span style="color: #298c52;"><strong> </strong></span><span style="color: #298c52;"><strong>version</strong></span>=<span style="color: #ff00ff;">"1.0"</span><span style="color: #298c52;"><strong> </strong></span><span style="color: #298c52;"><strong>encoding</strong></span>=<span style="color: #ff00ff;">"utf-8"</span><span style="color: #0000ff;">?&gt;</span> <span style="color: #a52929;"> 2</span> <span style="color: #a52929;"> 3</span>  <span style="color: #008c8c;">&lt;</span><span style="color: #008c8c;">jnlp</span><span style="color: #008c8c;"> </span><span style="color: #298c52;"><strong>spec</strong></span>=<span style="color: #ff00ff;">"0.2 1.0"</span> <span style="color: #a52929;"> 4</span>  <span style="color: #008c8c;">      </span><span style="color: #298c52;"><strong>codebase</strong></span>=<span style="color: #ff00ff;">"<a href="http://java.ist.unomaha.edu/~payne/demo">http://java.ist.unomaha.edu/~payne/demo"</a></span> <span style="color: #a52929;"> 5</span>  <span style="color: #008c8c;">      </span><span style="color: #298c52;"><strong>href</strong></span>=<span style="color: #ff00ff;">"demo.jnlp"</span><span style="color: #008c8c;">&gt;</span> <span style="color: #a52929;"> 6</span>     <span style="color: #008c8c;">&lt;</span><span style="color: #008c8c;">information</span><span style="color: #008c8c;">&gt;</span> <span style="color: #a52929;"> 7</span>        <span style="color: #008c8c;">&lt;</span><span style="color: #008c8c;">title</span><span style="color: #008c8c;">&gt;</span>demo<span style="color: #008c8c;"> <span style="color: #a52929;"> 8</span>        <span style="color: #008c8c;">&lt;</span><span style="color: #008c8c;">vendor</span><span style="color: #008c8c;">&gt;</span>Nice to put a homepage URL here <span style="color: #008c8c;"> <span style="color: #a52929;"> 9</span>        <span style="color: #008c8c;">&lt;</span><span style="color: #008c8c;">description</span><span style="color: #008c8c;">&gt;</span>This description may be long. <span style="color: #a52929;">10</span>        <span style="color: #008c8c;"> <span style="color: #a52929;">11</span>        <span style="color: #008c8c;">&lt;</span><span style="color: #008c8c;">offline-allowed</span><span style="color: #008c8c;">/&gt;</span> <span style="color: #a52929;">12</span>     <span style="color: #008c8c;"> <span style="color: #a52929;">13</span>     <span style="color: #008c8c;">&lt;</span><span style="color: #008c8c;">resources</span><span style="color: #008c8c;">&gt;</span> <span style="color: #a52929;">14</span>        <span style="color: #008c8c;">&lt;</span><span style="color: #008c8c;">j2se</span><span style="color: #008c8c;"> </span><span style="color: #298c52;"><strong>version</strong></span>=<span style="color: #ff00ff;">"1.3+ 1.2+"</span><span style="color: #008c8c;">/&gt;</span> <span style="color: #a52929;">15</span>        <span style="color: #008c8c;">&lt;</span><span style="color: #008c8c;">jar</span><span style="color: #008c8c;"> </span><span style="color: #298c52;"><strong>href</strong></span>=<span style="color: #ff00ff;">"demo.jar"</span><span style="color: #008c8c;"> </span><span style="color: #298c52;"><strong>main</strong></span>=<span style="color: #ff00ff;">"true"</span><span style="color: #008c8c;"> </span><span style="color: #298c52;"><strong>download</strong></span>=<span style="color: #ff00ff;">"eager"</span><span style="color: #008c8c;">/&gt;</span> <span style="color: #a52929;">16</span>     <span style="color: #008c8c;"> <span style="color: #a52929;">17</span>     <span style="color: #008c8c;">&lt;</span><span style="color: #008c8c;">application-desc</span><span style="color: #008c8c;"> </span><span style="color: #298c52;"><strong>main-class</strong></span>=<span style="color: #ff00ff;">"edu.unomaha.demo.Demo"</span><span style="color: #008c8c;">/&gt;</span> <span style="color: #a52929;">18</span>     <span style="color: #008c8c;">&lt;</span><span style="color: #008c8c;">security</span><span style="color: #008c8c;">&gt;</span> <span style="color: #008c8c;">&lt;</span><span style="color: #008c8c;">all-permissions</span><span style="color: #008c8c;">/&gt;</span> <span style="color: #008c8c;"> <span style="color: #a52929;">19</span>  <span style="color: #008c8c;"> </span></span></span></span></span></span></span></span></span></span></pre>
<span style="color: #6b5ace;"><span style="color: #6b5ace;"><span style="color: #0000ff;"><span style="color: #008c8c;"><span style="color: #008c8c;"><span style="color: #008c8c;"><span style="color: #008c8c;"><span style="color: #008c8c;"><span style="color: #6b5ace;"><span style="color: #0000ff;"> </span></span></span></span></span></span></span></span></span></span>
<h3><span style="color: #6b5ace;"><span style="color: #6b5ace;"><span style="color: #0000ff;"><span style="color: #008c8c;"><span style="color: #008c8c;"><span style="color: #008c8c;"><span style="color: #008c8c;"><span style="color: #008c8c;"><span style="color: #6b5ace;"><span style="color: #0000ff;">Signing JAR files with ant</span></span></span></span></span></span></span></span></span></span></h3>
<span style="color: #6b5ace;"><span style="color: #6b5ace;"><span style="color: #0000ff;"><span style="color: #008c8c;"><span style="color: #008c8c;"><span style="color: #008c8c;"><span style="color: #008c8c;"><span style="color: #008c8c;"><span style="color: #6b5ace;"><span style="color: #0000ff;"> If you need to setup ant on a unix box (and you're running bash) You will also need to add these lines to your ./bash_profile </span></span></span></span></span></span></span></span></span></span>
<pre><span style="color: #6b5ace;"><span style="color: #6b5ace;"><span style="color: #0000ff;"><span style="color: #008c8c;"><span style="color: #008c8c;"><span style="color: #008c8c;"><span style="color: #008c8c;"><span style="color: #008c8c;"><span style="color: #6b5ace;"><span style="color: #0000ff;">export JAVA_HOME=/usr/java/j2sdk1.4.1_01 # may have diff value for you export ANT_HOME=/usr/java/ant export PATH=${JAVA_HOME}/bin:${ANT_HOME}/bin:${PATH} </span></span></span></span></span></span></span></span></span></span></pre>
<span style="color: #6b5ace;"><span style="color: #6b5ace;"><span style="color: #0000ff;"><span style="color: #008c8c;"><span style="color: #008c8c;"><span style="color: #008c8c;"><span style="color: #008c8c;"><span style="color: #008c8c;"><span style="color: #6b5ace;"><span style="color: #0000ff;"> </span></span><span style="color: #6b5ace;"><span style="color: #0000ff;"> <a href="http://www.mattpayne.org/blog/build.xml">This ant file</a> signs all the jar files in the current directory. Just type the command "ant" and the files will be digitally signed. It's best to do a "ls -l *.jar;ant;ls -l *.jar" and notice that they are all a bit larger. </span></span></span></span></span></span></span></span></span></span>
<pre><span style="color: #6b5ace;"><span style="color: #6b5ace;"><span style="color: #0000ff;"><span style="color: #008c8c;"><span style="color: #008c8c;"><span style="color: #008c8c;"><span style="color: #008c8c;"><span style="color: #008c8c;"><span style="color: #6b5ace;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #298c52;"><strong>xml</strong></span><span style="color: #298c52;"><strong> </strong></span><span style="color: #298c52;"><strong>version</strong></span>=<span style="color: #ff00ff;">"1.0"</span><span style="color: #0000ff;">?&gt;</span> <span style="color: #008c8c;">&lt;</span><span style="color: #a52929;"><strong>project</strong></span><span style="color: #008c8c;"> </span><span style="color: #298c52;"><strong>default</strong></span>=<span style="color: #ff00ff;">"signit"</span><span style="color: #008c8c;"> </span><span style="color: #298c52;"><strong>basedir</strong></span>=<span style="color: #ff00ff;">"."</span><span style="color: #008c8c;">&gt;</span>   <span style="color: #008c8c;">&lt;</span><span style="color: #a52929;"><strong>target</strong></span><span style="color: #008c8c;"> </span><span style="color: #298c52;"><strong>name</strong></span>=<span style="color: #ff00ff;">"createkey"</span><span style="color: #008c8c;">&gt;</span>   <span style="color: #008c8c;">&lt;</span><span style="color: #a52929;"><strong>genkey</strong></span><span style="color: #008c8c;"> </span><span style="color: #298c52;"><strong>alias</strong></span>=<span style="color: #ff00ff;">"autosigner"</span><span style="color: #008c8c;"> </span><span style="color: #298c52;"><strong>keystore</strong></span>=<span style="color: #ff00ff;">"local.keystore"</span><span style="color: #008c8c;"> </span> <span style="color: #008c8c;">    </span><span style="color: #298c52;"><strong>storepass</strong></span>=<span style="color: #ff00ff;">"atLeastSixChars"</span><span style="color: #008c8c;">&gt;</span>     <span style="color: #008c8c;">&lt;</span><span style="color: #a52929;"><strong>dname</strong></span><span style="color: #008c8c;">&gt;</span>       <span style="color: #008c8c;">&lt;</span><span style="color: #a52929;"><strong>param</strong></span><span style="color: #008c8c;"> </span><span style="color: #298c52;"><strong>name</strong></span>=<span style="color: #ff00ff;">"CN"</span><span style="color: #008c8c;"> </span><span style="color: #298c52;"><strong>value</strong></span>=<span style="color: #ff00ff;">"autosigner"</span><span style="color: #008c8c;">/&gt;</span>       <span style="color: #008c8c;">&lt;</span><span style="color: #a52929;"><strong>param</strong></span><span style="color: #008c8c;"> </span><span style="color: #298c52;"><strong>name</strong></span>=<span style="color: #ff00ff;">"OU"</span><span style="color: #008c8c;"> </span><span style="color: #298c52;"><strong>value</strong></span>=<span style="color: #ff00ff;">"Joe Blow"</span><span style="color: #008c8c;">/&gt;</span>       <span style="color: #008c8c;">&lt;</span><span style="color: #a52929;"><strong>param</strong></span><span style="color: #008c8c;"> </span><span style="color: #298c52;"><strong>name</strong></span>=<span style="color: #ff00ff;">"O"</span><span style="color: #008c8c;"> </span><span style="color: #298c52;"><strong>value</strong></span>=<span style="color: #ff00ff;">"Joe"</span><span style="color: #008c8c;">/&gt;</span>       <span style="color: #008c8c;">&lt;</span><span style="color: #a52929;"><strong>param</strong></span><span style="color: #008c8c;"> </span><span style="color: #298c52;"><strong>name</strong></span>=<span style="color: #ff00ff;">"C"</span><span style="color: #008c8c;"> </span><span style="color: #298c52;"><strong>value</strong></span>=<span style="color: #ff00ff;">"US"</span><span style="color: #008c8c;">/&gt;</span>     <span style="color: #008c8c;"><!--</font--><span style="color: #a52929;"><strong>dname</strong></span><span style="color: #008c8c;">&gt;</span>   <span style="color: #008c8c;"><!--</font--><span style="color: #a52929;"><strong>genkey</strong></span><span style="color: #008c8c;">&gt;</span> <span style="color: #008c8c;"><!--</font--><span style="color: #a52929;"><strong>target</strong></span><span style="color: #008c8c;">&gt;</span>   <span style="color: #008c8c;">&lt;</span><span style="color: #a52929;"><strong>target</strong></span><span style="color: #008c8c;"> </span><span style="color: #298c52;"><strong>name</strong></span>=<span style="color: #ff00ff;">"signit"</span><span style="color: #008c8c;"> </span><span style="color: #298c52;"><strong>depends</strong></span>=<span style="color: #ff00ff;">"createkey"</span><span style="color: #008c8c;">&gt;</span>   <span style="color: #008c8c;">&lt;</span><span style="color: #a52929;"><strong>signjar</strong></span><span style="color: #008c8c;"> </span><span style="color: #298c52;"><strong>jar</strong></span>=<span style="color: #ff00ff;">"demo.jar"</span> <span style="color: #008c8c;">    </span><span style="color: #298c52;"><strong>alias</strong></span>=<span style="color: #ff00ff;">"autosigner"</span><span style="color: #008c8c;"> </span><span style="color: #298c52;"><strong>keystore</strong></span>=<span style="color: #ff00ff;">"local.keystore"</span><span style="color: #008c8c;"> </span><span style="color: #298c52;"><strong>storepass</strong></span>=<span style="color: #ff00ff;">"atLeastSixChars"</span> <span style="color: #008c8c;">    </span><span style="color: #298c52;"><strong>verbose</strong></span>=<span style="color: #ff00ff;">"true"</span><span style="color: #008c8c;">&gt;</span>     <span style="color: #0000ff;"><!--</font--><span style="color: #0000ff;">-- sign all jars in the current working directory. --</span><span style="color: #0000ff;">&gt;</span>     <span style="color: #008c8c;">&lt;</span><span style="color: #a52929;"><strong>fileset</strong></span><span style="color: #008c8c;"> </span><span style="color: #298c52;"><strong>dir</strong></span>=<span style="color: #ff00ff;">"."</span><span style="color: #008c8c;">&gt;&lt;</span><span style="color: #a52929;"><strong>include</strong></span><span style="color: #008c8c;"> </span><span style="color: #298c52;"><strong>name</strong></span>=<span style="color: #ff00ff;">"*.jar"</span><span style="color: #008c8c;">/&gt;</span><span style="color: #008c8c;"><!--</font--><span style="color: #a52929;"><strong>fileset</strong></span><span style="color: #008c8c;">&gt;</span>   <span style="color: #008c8c;"><!--</font--><span style="color: #a52929;"><strong>signjar</strong></span><span style="color: #008c8c;">&gt;</span> <span style="color: #008c8c;"><!--</font--><span style="color: #a52929;"><strong>target</strong></span><span style="color: #008c8c;">&gt;</span>  <span style="color: #008c8c;"><!--</font--><span style="color: #a52929;"><strong>project</strong></span><span style="color: #008c8c;">&gt;</span>  </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></pre>]]></content:encoded>
			<wfw:commentRss>http://www.mattpayne.org/blog/2005/03/13/java-web-start-quick-start/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.454 seconds -->
