<?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>Baccega Andrea Blog</title>
	<atom:link href="http://www.andreabaccega.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.andreabaccega.com/blog</link>
	<description>The future is web3.0</description>
	<lastBuildDate>Wed, 09 May 2012 20:02:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Introducing Flatterizor</title>
		<link>http://www.andreabaccega.com/blog/2012/05/09/introducing-flatterizor/</link>
		<comments>http://www.andreabaccega.com/blog/2012/05/09/introducing-flatterizor/#comments</comments>
		<pubDate>Wed, 09 May 2012 19:49:03 +0000</pubDate>
		<dc:creator>veke87</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[flatterizor]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.andreabaccega.com/blog/?p=562</guid>
		<description><![CDATA[Flatterizor is a PHP library developed in order to issue a very specific problem. Sometimes you have a complex object and you need to store it into your database. Most cases the serialize function does work. Unfortunately sometimes it does &#8230; <p><a class="btn small" href="http://www.andreabaccega.com/blog/2012/05/09/introducing-flatterizor/">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
			<content:encoded><![CDATA[<p>Flatterizor is a PHP library developed in order to issue a very specific problem.</p>
<p>Sometimes you have a complex object and you need to store it into your database. Most cases the serialize function does work. Unfortunately sometimes it does not ( not because serialize is broken/bugged ).</p>
<p>The Library is useful only if the followings are true:</p>
<ul>
<li>You want to store your object inside a database</li>
<li>Your object is not &#8220;Flat&#8221;  ( meaning you&#8217;ve at least a value in your object that is an array or an object itself )</li>
<li>You want to use your Database SQL to Search &amp; filter objects with a particular value.</li>
</ul>
<p>The last sentence is actually the most appealing. Lets take, for example, the following objects:</p>
<div id="gist-2645847" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="cp">&lt;?php</span> </div><div class='line' id='LC2'>&nbsp;&nbsp;<span class="nv">$bob</span> <span class="o">=</span> <span class="k">new</span> <span class="k">stdClass</span><span class="p">();</span></div><div class='line' id='LC3'>&nbsp;&nbsp;<span class="nv">$bob</span><span class="o">-&gt;</span><span class="na">name</span> <span class="o">=</span> <span class="s1">&#39;Bob&#39;</span><span class="p">;</span></div><div class='line' id='LC4'>&nbsp;&nbsp;<span class="nv">$bob</span><span class="o">-&gt;</span><span class="na">permissions</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span> <span class="p">);</span></div><div class='line' id='LC5'>&nbsp;&nbsp;<span class="nv">$bob</span><span class="o">-&gt;</span><span class="na">permissions</span><span class="p">[</span><span class="s1">&#39;can_write&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="k">true</span><span class="p">;</span></div><div class='line' id='LC6'>&nbsp;&nbsp;<span class="nv">$bob</span><span class="o">-&gt;</span><span class="na">permissions</span><span class="p">[</span><span class="s1">&#39;can_read&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="k">true</span><span class="p">;</span></div><div class='line' id='LC7'><br/></div><div class='line' id='LC8'>&nbsp;&nbsp;<span class="nv">$mat</span> <span class="o">=</span> <span class="k">new</span> <span class="k">stdClass</span><span class="p">();</span></div><div class='line' id='LC9'>&nbsp;&nbsp;<span class="nv">$mat</span><span class="o">-&gt;</span><span class="na">name</span> <span class="o">=</span> <span class="s1">&#39;Mat&#39;</span><span class="p">;</span></div><div class='line' id='LC10'>&nbsp;&nbsp;<span class="nv">$mat</span><span class="o">-&gt;</span><span class="na">permissions</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span> <span class="p">);</span></div><div class='line' id='LC11'>&nbsp;&nbsp;<span class="nv">$mat</span><span class="o">-&gt;</span><span class="na">permissions</span><span class="p">[</span><span class="s1">&#39;can_write&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="k">false</span><span class="p">;</span></div><div class='line' id='LC12'>&nbsp;&nbsp;<span class="nv">$mat</span><span class="o">-&gt;</span><span class="na">permissions</span><span class="p">[</span><span class="s1">&#39;can_read&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="k">true</span><span class="p">;</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/877e75726f1dc98915fa/de7b48f1ad210e298901e53b58aefd86ddb19aa4/objects.php" style="float:right;">view raw</a>
            <a href="https://gist.github.com/877e75726f1dc98915fa#file_objects.php" style="float:right;margin-right:10px;color:#666">objects.php</a>
            <a href="https://gist.github.com/877e75726f1dc98915fa">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p><span id="more-562"></span></p>
<p>Mat and Bob are 2 users. We&#8217;d like to persist them in a database but You can&#8217;t design a Database Table that scales well. Why?</p>
<ol>
<li>Cause maybe you&#8217;ll also add a &#8220;surname&#8221; key sometimes in the future</li>
<li>Cause you don&#8217;t know if you&#8217;ll add other permissions in the future ( Sub-Set of the previous sentence )</li>
</ol>
<p>So, what stops us to use serialize() ? Well, take a look to how <em>$mat</em> looks when &#8220;serialized&#8221;</p>
<div id="gist-2645847" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'>O:8:&quot;stdClass&quot;:2:{s:4:&quot;name&quot;;s:3:&quot;Mat&quot;;s:11:&quot;permissions&quot;;a:2:s:9:&quot;can_write&quot;;b:0;s:8:&quot;can_read&quot;;b:1;}}</div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/877e75726f1dc98915fa/41a8db8a86a0310c23c1c4ff01e09f200fe48ca7/mat_serialized.serialize" style="float:right;">view raw</a>
            <a href="https://gist.github.com/877e75726f1dc98915fa#file_mat_serialized.serialize" style="float:right;margin-right:10px;color:#666">mat_serialized.serialize</a>
            <a href="https://gist.github.com/877e75726f1dc98915fa">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>Good Luck creating an SQL Query that finds all the users that have the permission to write. <img src='http://www.andreabaccega.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Using <strong>Flatterizor</strong> you&#8217;ll have a completely different output. First, lets see how our code would change if we&#8217;re going to use the library.</p>
<div id="gist-2645847" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="cp">&lt;?php</span></div><div class='line' id='LC2'>&nbsp;&nbsp;<span class="k">require_once</span><span class="p">(</span><span class="s1">&#39;./classes/flatterizor.class.php&#39;</span><span class="p">);</span></div><div class='line' id='LC3'><br/></div><div class='line' id='LC4'>&nbsp;&nbsp;<span class="nv">$mat</span> <span class="o">=</span> <span class="k">new</span> <span class="k">stdClass</span><span class="p">();</span></div><div class='line' id='LC5'>&nbsp;&nbsp;<span class="nv">$mat</span><span class="o">-&gt;</span><span class="na">name</span> <span class="o">=</span> <span class="s1">&#39;Mat&#39;</span><span class="p">;</span></div><div class='line' id='LC6'>&nbsp;&nbsp;<span class="nv">$mat</span><span class="o">-&gt;</span><span class="na">permissions</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span> <span class="p">);</span></div><div class='line' id='LC7'>&nbsp;&nbsp;<span class="nv">$mat</span><span class="o">-&gt;</span><span class="na">permissions</span><span class="p">[</span><span class="s1">&#39;can_write&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="k">false</span><span class="p">;</span></div><div class='line' id='LC8'>&nbsp;&nbsp;<span class="nv">$mat</span><span class="o">-&gt;</span><span class="na">permissions</span><span class="p">[</span><span class="s1">&#39;can_read&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="k">true</span><span class="p">;</span></div><div class='line' id='LC9'><br/></div><div class='line' id='LC10'>&nbsp;&nbsp;<span class="nv">$flatterizor</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">ObjectFlatterizor</span><span class="p">(</span><span class="k">true</span><span class="p">);</span></div><div class='line' id='LC11'>&nbsp;&nbsp;<span class="nv">$matGoodLooking</span> <span class="o">=</span> <span class="nv">$flatterizor</span><span class="o">-&gt;</span><span class="na">flatterize</span><span class="p">(</span><span class="nv">$mat</span><span class="p">);</span></div><div class='line' id='LC12'>&nbsp;&nbsp;<span class="nb">var_dump</span><span class="p">(</span><span class="nv">$matGoodLooking</span><span class="p">);</span></div><div class='line' id='LC13'><br/></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/877e75726f1dc98915fa/97758b9bf85cb814cb15287f9c73438c19fdbf10/mat_flatterizor.php" style="float:right;">view raw</a>
            <a href="https://gist.github.com/877e75726f1dc98915fa#file_mat_flatterizor.php" style="float:right;margin-right:10px;color:#666">mat_flatterizor.php</a>
            <a href="https://gist.github.com/877e75726f1dc98915fa">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>The output of the flatterize method is an object with 2 keys:</p>
<ul>
<li><strong>objectDefinitions</strong>:  Used to rebuild the object it contains a plain array of strings with the name of the classes and their paths</li>
<li><strong>values</strong>:  An array of arrays. Each array will contain 2 keys</li>
<ul>
<li><strong>path</strong>:  It&#8217;s the path of the value</li>
<li><strong>val</strong></li>
</ul>
</ul>
<p>Let&#8217;s take a look to the var_dump output.</p>
<div id="gist-2645847" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'>object(stdClass)#4 (2) {</div><div class='line' id='LC2'>&nbsp;&nbsp;[&quot;objectDefinitions&quot;]=&gt;</div><div class='line' id='LC3'>&nbsp;&nbsp;array(1) {</div><div class='line' id='LC4'>&nbsp;&nbsp;&nbsp;&nbsp;[&quot;/&quot;]=&gt;</div><div class='line' id='LC5'>&nbsp;&nbsp;&nbsp;&nbsp;string(8) &quot;stdClass&quot;</div><div class='line' id='LC6'>&nbsp;&nbsp;}</div><div class='line' id='LC7'>&nbsp;&nbsp;[&quot;values&quot;]=&gt;</div><div class='line' id='LC8'>&nbsp;&nbsp;array(3) {</div><div class='line' id='LC9'>&nbsp;&nbsp;&nbsp;&nbsp;[0]=&gt;</div><div class='line' id='LC10'>&nbsp;&nbsp;&nbsp;&nbsp;array(2) {</div><div class='line' id='LC11'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&quot;path&quot;]=&gt;</div><div class='line' id='LC12'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string(5) &quot;/name&quot;</div><div class='line' id='LC13'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&quot;val&quot;]=&gt;</div><div class='line' id='LC14'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string(3) &quot;Mat&quot;</div><div class='line' id='LC15'>&nbsp;&nbsp;&nbsp;&nbsp;}</div><div class='line' id='LC16'>&nbsp;&nbsp;&nbsp;&nbsp;[1]=&gt;</div><div class='line' id='LC17'>&nbsp;&nbsp;&nbsp;&nbsp;array(2) {</div><div class='line' id='LC18'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&quot;path&quot;]=&gt;</div><div class='line' id='LC19'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string(24) &quot;/permissions/[can_write]&quot;</div><div class='line' id='LC20'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&quot;val&quot;]=&gt;</div><div class='line' id='LC21'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bool(false)</div><div class='line' id='LC22'>&nbsp;&nbsp;&nbsp;&nbsp;}</div><div class='line' id='LC23'>&nbsp;&nbsp;&nbsp;&nbsp;[2]=&gt;</div><div class='line' id='LC24'>&nbsp;&nbsp;&nbsp;&nbsp;array(2) {</div><div class='line' id='LC25'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&quot;path&quot;]=&gt;</div><div class='line' id='LC26'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string(23) &quot;/permissions/[can_read]&quot;</div><div class='line' id='LC27'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&quot;val&quot;]=&gt;</div><div class='line' id='LC28'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bool(true)</div><div class='line' id='LC29'>&nbsp;&nbsp;&nbsp;&nbsp;}</div><div class='line' id='LC30'>&nbsp;&nbsp;}</div><div class='line' id='LC31'>}</div><div class='line' id='LC32'><br/></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/877e75726f1dc98915fa/d90840562daedc6fdccee4e1471ef0e0e5206e7f/vardump_output.txt" style="float:right;">view raw</a>
            <a href="https://gist.github.com/877e75726f1dc98915fa#file_vardump_output.txt" style="float:right;margin-right:10px;color:#666">vardump_output.txt</a>
            <a href="https://gist.github.com/877e75726f1dc98915fa">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>The end goal was to persist the object inside a database so that we could easily search through an SQL Query. For the example I designed the following database table.</p>
<div id="gist-2645847" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="k">CREATE</span> <span class="k">TABLE</span> <span class="n">IF</span> <span class="k">NOT</span> <span class="k">EXISTS</span> <span class="o">`</span><span class="n">userinfos</span><span class="o">`</span> <span class="p">(</span></div><div class='line' id='LC2'>&nbsp;&nbsp;<span class="o">`</span><span class="n">userID</span><span class="o">`</span> <span class="nb">int</span><span class="p">(</span><span class="mi">11</span><span class="p">)</span> <span class="k">NOT</span> <span class="k">NULL</span> <span class="n">AUTO_INCREMENT</span><span class="p">,</span></div><div class='line' id='LC3'>&nbsp;&nbsp;<span class="o">`</span><span class="n">name</span><span class="o">`</span> <span class="nb">varchar</span><span class="p">(</span><span class="mi">256</span><span class="p">)</span> <span class="k">NOT</span> <span class="k">NULL</span><span class="p">,</span></div><div class='line' id='LC4'>&nbsp;&nbsp;<span class="o">`</span><span class="n">val</span><span class="o">`</span> <span class="nb">varchar</span><span class="p">(</span><span class="mi">256</span><span class="p">)</span> <span class="k">NOT</span> <span class="k">NULL</span><span class="p">,</span></div><div class='line' id='LC5'>&nbsp;&nbsp;<span class="k">PRIMARY</span> <span class="k">KEY</span> <span class="p">(</span><span class="o">`</span><span class="n">userID</span><span class="o">`</span><span class="p">,</span><span class="o">`</span><span class="n">name</span><span class="o">`</span><span class="p">),</span></div><div class='line' id='LC6'>&nbsp;&nbsp;<span class="k">KEY</span> <span class="o">`</span><span class="n">name</span><span class="o">`</span> <span class="p">(</span><span class="o">`</span><span class="n">name</span><span class="o">`</span><span class="p">)</span></div><div class='line' id='LC7'><span class="p">)</span> <span class="n">ENGINE</span><span class="o">=</span><span class="n">InnoDB</span> <span class="k">DEFAULT</span> <span class="n">CHARSET</span><span class="o">=</span><span class="n">latin1</span> <span class="n">AUTO_INCREMENT</span><span class="o">=</span><span class="mi">1</span> <span class="p">;</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/877e75726f1dc98915fa/83ed2e7bca012c3fdf21b7e6642b1b05249f99c8/userinfo.sql" style="float:right;">view raw</a>
            <a href="https://gist.github.com/877e75726f1dc98915fa#file_userinfo.sql" style="float:right;margin-right:10px;color:#666">userinfo.sql</a>
            <a href="https://gist.github.com/877e75726f1dc98915fa">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>In our example we&#8217;ll need to perform a loop on <em>$matGoodLooking-&gt;values</em> and insert the values inside the table where</p>
<ul>
<li>&#8216;<em>path</em>&#8216; will be mapped in the &#8216;<em>name</em>&#8216; column</li>
<li>&#8216;<em>val</em>&#8216;  will be mapped in the &#8216;<em>val</em>&#8216; column</li>
</ul>
<div>After inserting Mat and Bob into the database this is how the table should look:</div>
<div>
<table class="aligncenter" width="294" border="0" cellspacing="0" cellpadding="0">
<colgroup>
<col width="64" />
<col width="166" />
<col width="64" /> </colgroup>
<thead>
<tr>
<th>userID</th>
<th>name</th>
<th>val</th>
</tr>
</thead>
<tbody>
<tr>
<td height="20">1</td>
<td>/name</td>
<td>Mat</td>
</tr>
<tr>
<td height="20">1</td>
<td>/permissions/[can_write]</td>
<td>false</td>
</tr>
<tr>
<td height="20">1</td>
<td>/permissions/[can_read]</td>
<td>true</td>
</tr>
<tr>
<td height="20">2</td>
<td>/name</td>
<td>Bob</td>
</tr>
<tr>
<td height="20">2</td>
<td>/permissions/[can_write]</td>
<td>true</td>
</tr>
<tr>
<td height="20">2</td>
<td>/permissions/[can_read]</td>
<td>true</td>
</tr>
</tbody>
</table>
</div>
<p>With a very simple SQL Statement we&#8217;ll be able to find all the  users that have the ability to write.</p>
<div id="gist-2645847" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="k">SELECT</span> <span class="n">userID</span> <span class="k">from</span> <span class="n">userinfos</span></div><div class='line' id='LC2'><span class="k">WHERE</span> <span class="n">name</span><span class="o">=</span><span class="s1">&#39;/permissions/[can_write]&#39;</span> </div><div class='line' id='LC3'><span class="k">AND</span> <span class="n">val</span><span class="o">=</span><span class="s1">&#39;true&#39;</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/877e75726f1dc98915fa/40446226f5117702814c3af9fc4f9ab17c8bb31b/search_1.sql" style="float:right;">view raw</a>
            <a href="https://gist.github.com/877e75726f1dc98915fa#file_search_1.sql" style="float:right;margin-right:10px;color:#666">search_1.sql</a>
            <a href="https://gist.github.com/877e75726f1dc98915fa">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p><strong>Note</strong>: It&#8217;s not hard to understand that if you&#8217;ve a lot of users, the table is going to fill your disk space very quickly. There&#8217;re a lot of solutions to this so I won&#8217;t cover them here.</p>
<p>Sooner or later you&#8217;ll want to retrieve your users in the original form. Doing that is very easy&#8230; just use the static method called ObjectFlatterizor::rebuild . It accepts 1 parameter which is the <strong>exact</strong> output of the flatterize() method&#8230; <span style="text-decoration: underline;">you&#8217;ll be required to rebuild it correctly</span>.</p>
<h3>Using with WordPress</h3>
<p>The idea came working with WordPress. I had a Box inside the &#8220;<em>Post Edit</em>&#8221; screen, this box contained ~30 input fields. I then created a way to save those fields in an object. Soon I realized I needed to search posts using this object values&#8230; since WordPress provides a way to search posts using the post_meta values,  I built the library to serialize/deserialize my objects in the post_meta table.</p>
<p>The whole thing works very well <img src='http://www.andreabaccega.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Authors</h3>
<ul>
<li>Andrea Baccega <a href="mailto:me@andreabaccega.com">me@andreabaccega.com</a> - <em>Author/Ideator of the library</em></li>
<li>Emanuele &#8216;Tex&#8217; Tessore <a href="mailto:setola@gmail.com">setola@gmail.com</a> - <em>Contributor of the library</em></li>
</ul>
<h3>More infos</h3>
<p>I strongly suggest to:</p>
<ul>
<li>take a look <a href="https://github.com/vekexasia/php-object-flatterizor">@ github</a></li>
<li>take a look <a href="https://github.com/vekexasia/php-object-flatterizor/tree/master/demo">@ the demo folder</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.andreabaccega.com/blog/2012/05/09/introducing-flatterizor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to backup your web server data [rsnapshot + rsync + ssh]</title>
		<link>http://www.andreabaccega.com/blog/2012/04/23/how-to-backup-your-web-server-data-rsnapshot-rsync-ssh/</link>
		<comments>http://www.andreabaccega.com/blog/2012/04/23/how-to-backup-your-web-server-data-rsnapshot-rsync-ssh/#comments</comments>
		<pubDate>Mon, 23 Apr 2012 21:28:22 +0000</pubDate>
		<dc:creator>veke87</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[rsnapshot]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.andreabaccega.com/blog/?p=535</guid>
		<description><![CDATA[You start doing some research about this topic when one of the following events occurs: You lose your data You start hosting third party data Why? We usually start making backups cause we don&#8217;t want to lose important bits. ( &#8230; <p><a class="btn small" href="http://www.andreabaccega.com/blog/2012/04/23/how-to-backup-your-web-server-data-rsnapshot-rsync-ssh/">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
			<content:encoded><![CDATA[<p>You start doing some research about this topic when one of the following events occurs:</p>
<ul>
<li>You lose your data</li>
<li>You start hosting third party data</li>
</ul>
<p><span id="more-535"></span></p>
<h3><strong>Why?</strong></h3>
<p>We usually start making backups cause we don&#8217;t want to lose important bits. ( or at least we want to minimize the amount of lost data )</p>
<h3><strong>What?</strong></h3>
<p>This question could be easily under-estimated. This is, imho, one of the most important question when talking about backups.</p>
<p>In my case I wanted to backup:</p>
<ul>
<li>My config files ( apache, mysql, nginx etc )</li>
<li>The www directory</li>
<li>mysql data</li>
</ul>
<h3><strong>Where?</strong></h3>
<p>The backup location differs proportionally with the &#8220;security level&#8221; you want to get.</p>
<p>In some case scenarios it could be enough to backup your data using the same Hard Drive but just in a different folder.</p>
<p>So here i&#8217;ll propose a quick Q&amp;A. list to help you pick the correct &#8220;Where&#8221; answer:</p>
<ul>
<li>Covered from unwanted file deletions =&gt; backup on a different folder</li>
<li>Covered from hard drive failure =&gt; backup on a different hard drive</li>
<li>Covered from robbering/flames/water =&gt; backup on a different machine on another location</li>
<li>Covered from large scale issues ( Earthquakes, Tsunamis, Aliens? ) =&gt;backup on different machine(s) on another country/continent</li>
</ul>
<div>In this howto we will backup the data using a different server <img src='http://www.andreabaccega.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  .</div>
<h3>How?</h3>
<p>There&#8217;s no definitive answer to this question! There are only best-practices you can put in place!</p>
<p><strong>The first rule:</strong> Running several servers I learned that the server containing the data we want to backup should not be ( as much as possible ) involved in the backup process. I used to backup my data with some scripts inside the same server, I discovered this approach is not scalable and somehow not reliable as I wanted it to be.</p>
<p><strong>The second rule</strong> (which is also an effect of the previous one ) is: do not send your backup to the backup servers, let the B.S. fetch the data it needs. Why? Suppouse your server get hacked and the attacker decides to look around and find your scripts, this could lead to 2 problems:</p>
<ol>
<li>If you didn&#8217;t configure the backup server <acronym title="Access Control List">ACL</acronym>s correctly you&#8217;re going to give the attacker free access also to your backup servers.</li>
<li>They&#8217;ll be able to delete your data also from your backup servers.</li>
</ol>
<p><strong>The third rule</strong>: do not re-invent the wheel. There are a lot of free tools in the internet you can use. In my scenario i picked these ones:</p>
<ul>
<li><strong><a href="http://en.wikipedia.org/wiki/Rsync">rsync</a></strong>: very popular sync tool for windows and linux</li>
<li><a href="http://rsnapshot.org/"><strong>rsnapshot</strong>:</a> a very handy tool that works close with rsync to make incremental backups in a <strong>very efficient way</strong></li>
<li><strong>mysqldump:</strong> the console based backup tool.</li>
</ul>
<h3>When?</h3>
<p>This is also a crucial question and you&#8217;ll need to think about the answer very carefully. It all depends on you and there are no strict rules on this.</p>
<h2>My Setup</h2>
<p>I probably already mentioned I&#8217;ve some web servers. Since some days ago each of them were taking care about its own backup. I manually created a bunch of highly customizable scripts that I used for more than a year now.</p>
<p>Even if I don&#8217;t like to change things that simply works I love to improve &amp; optimize.</p>
<p>The old setup was:</p>
<ul>
<li>Each web server had a script that was responsible of backing up files and databases,</li>
<li>Each web server had another script which connected to a remote ftp and send those backups there</li>
<li>The backup granularity was daily and I had at least 1 week of data.</li>
</ul>
<p>The new setup i wanted was:</p>
<ul>
<li>A new backup server that takes care of everything.</li>
<li>Only one place where i could change my backup parameters for all the servers.</li>
</ul>
<p>Obviously the new setup is more complex and expensive than the previous one, but I didn&#8217;t want to live with the old setup anymore.</p>
<p>I searched for a backup server online and I eventually found a low-end dedicated server which had with very poor cpu performance but enough space for my needs.</p>
<h3>First of all create a user</h3>
<p>On the <span style="text-decoration: underline;">webserver you&#8217;d like to backup</span> i suggest to add a brand new user that will handle all the stuff we need to backup our data. The whole &#8220;tutorial&#8221; is based on this step.</p>
<p>For you lazy sysadmins here is the shell command you should launch to create the user.</p>
<pre style="padding-left: 30px;">sudo adduser backupper</pre>
<p><strong>Note</strong>: I&#8217;ll refer to the &#8220;backupper&#8221; user in along the tutorial. If you decided to rename it then you should take care to replace the username below.</p>
<h3>Setting up regular mysql backups with cronjobs</h3>
<p>Data stored in mysql databases are usually, for a web server, a top priority that needs to be backed up regularly.</p>
<p>Before proceding setting up rsnapshot we will need to set up a mysql backup script that will be launched daily with a cronjob.  Before creating the script we need to create a user that, for security purposes, is only allowed to issue commands that are needed to mysqldump.</p>
<p>In order to do that you&#8217;ve to open the mysql console using your mysql admin/root password:</p>
<pre style="padding-left: 30px;">mysql -u root -p</pre>
<p>Then, choose a password for your new user and issue the following 2 sqls:<br />
<div id="gist-2463938" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="k">CREATE</span> <span class="k">USER</span> <span class="s1">&#39;backupuser&#39;</span><span class="o">@</span><span class="s1">&#39;localhost&#39;</span> <span class="n">IDENTIFIED</span> <span class="k">BY</span>  <span class="s1">&#39;your-password-here&#39;</span><span class="p">;</span></div><div class='line' id='LC2'><br/></div><div class='line' id='LC3'><span class="k">GRANT</span> <span class="k">SELECT</span> <span class="p">,</span> </div><div class='line' id='LC4'><span class="k">LOCK</span> <span class="n">TABLES</span> <span class="p">,</span> </div><div class='line' id='LC5'><span class="k">SHOW</span> <span class="k">VIEW</span> <span class="k">ON</span> <span class="o">*</span> <span class="p">.</span> <span class="o">*</span> <span class="k">TO</span>  <span class="s1">&#39;backupuser&#39;</span><span class="o">@</span><span class="s1">&#39;localhost&#39;</span> <span class="n">IDENTIFIED</span> <span class="k">BY</span>  <span class="s1">&#39;your-password-here&#39;</span> <span class="k">WITH</span> <span class="n">MAX_QUERIES_PER_HOUR</span> <span class="mi">0</span> <span class="n">MAX_CONNECTIONS_PER_HOUR</span> <span class="mi">0</span> <span class="n">MAX_UPDATES_PER_HOUR</span> <span class="mi">0</span> <span class="n">MAX_USER_CONNECTIONS</span> <span class="mi">0</span> <span class="p">;</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/0c0b86919ea5b4c16557/29ebdfb7e0e4266ffc863b796a3e66037a5583b1/create_backupuser.sql" style="float:right;">view raw</a>
            <a href="https://gist.github.com/0c0b86919ea5b4c16557#file_create_backupuser.sql" style="float:right;margin-right:10px;color:#666">create_backupuser.sql</a>
            <a href="https://gist.github.com/0c0b86919ea5b4c16557">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>
</p>
<p><strong>Note</strong>: replace the password<span style="text-decoration: underline;"><strong>s</strong></span> with your own</p>
<p>Once created the user create a file named .my.cnf inside the home directory of backupper user. ( /home/backupper ) with the following content</p>
<div id="gist-2463938" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'>[client]</div><div class='line' id='LC2'>&nbsp;&nbsp;&nbsp;host     = localhost</div><div class='line' id='LC3'>&nbsp;&nbsp;&nbsp;user     = backupuser</div><div class='line' id='LC4'>&nbsp;&nbsp;&nbsp;password = your-password-here</div><div class='line' id='LC5'>&nbsp;&nbsp;&nbsp;socket   = /var/run/mysqld/mysqld.sock</div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/0c0b86919ea5b4c16557/159948ba1e96d1950c4ca8f4aecfaea1216578e7/.my.cnf" style="float:right;">view raw</a>
            <a href="https://gist.github.com/0c0b86919ea5b4c16557#file_.my.cnf" style="float:right;margin-right:10px;color:#666">.my.cnf</a>
            <a href="https://gist.github.com/0c0b86919ea5b4c16557">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>In order to add a bit of security issue the following shell command</p>
<pre style="padding-left: 30px;">chmod 700 .my.cnf</pre>
<p>This will prevent other users to read the mysql configuration file.</p>
<p>To test the whole thing issue the following shell command:</p>
<pre style="padding-left: 30px;">mysql -Bse "show databases"</pre>
<p>If the result of this command is the list of your databases then everything was setted up correctly. If you get an error ( probably &#8220;Access denied&#8221; ) then you should double check all the previous steps.</p>
<p>Now that our mysql configuration is up and running we need a shell script that will take care to backup our databases for us. You can use the following simple script. Name it &#8220;backup_databases.sh&#8221; and place it inside /home/backupper.</p>
<div id="gist-2463938" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="c">#!/bin/bash</span></div><div class='line' id='LC2'>mkdir -p ~/mysqlbackups/</div><div class='line' id='LC3'><span class="k">for </span>i in <span class="k">$(</span>mysql -Bse <span class="s2">&quot;show databases&quot;</span><span class="k">)</span>; <span class="k">do</span></div><div class='line' id='LC4'><span class="k">        </span>mysqldump  <span class="nv">$i</span> &gt; ~/mysqlbackups/<span class="nv">$i</span>.sql</div><div class='line' id='LC5'><span class="k">done</span></div><div class='line' id='LC6'><br/></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/0c0b86919ea5b4c16557/38fd0dcc58c9621c3e4d7e10871817e9c27856c5/backup_databases.sh" style="float:right;">view raw</a>
            <a href="https://gist.github.com/0c0b86919ea5b4c16557#file_backup_databases.sh" style="float:right;margin-right:10px;color:#666">backup_databases.sh</a>
            <a href="https://gist.github.com/0c0b86919ea5b4c16557">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>If you&#8217;re familiar with bash scripts then you&#8217;ll easily understand how the code works. Btw, for the sake of clarity, every time you launch this script a complete backup of all your databases will be placed inside ~/mysqlbackups</p>
<p>The last step is to set up a cronjob that will launch the above mentioned shell script. It&#8217;s a good idea to let the cronjob start during the night ( expecially if your server is very busy during the day ). In my crontab i decided to fire the mysql backups at 01:10 each day.</p>
<pre style="padding-left: 30px;">sudo su backupper
crontab -e</pre>
<p>while editing the crontab add something like this</p>
<pre style="padding-left: 30px;">10 1 * * * /bin/bash /home/backupper/backup_databases.sh 2&gt;&amp;1 &gt; /dev/null</pre>
<p>Now everything related to mysql should be setted up!</p>
<h3>Setting up SSH with Public/Private keys</h3>
<p>Before going any further we need to make ssh authentication with public/private keys between the 2 servers work properly. There are a lot of tutorials online you can use but for clarity I&#8217;ll write the commands i launched:</p>
<p>On the backup server:</p>
<pre style="padding-left: 30px;">cd ~/.ssh
ssh-keygen -f rsynckey -C 'My Rsync Key' -N '' -t rsa -q</pre>
<p>Once the key is created you&#8217;ll need to copy the <strong>public key on the web server</strong> appending/creating something <span style="text-decoration: underline;">like</span> this to the file /home/backupper/.ssh/authorized_keys</p>
<pre style="padding-left: 30px;">ssh-rsa AAAAB3NzaC.......NbPjH veke@backupserver</pre>
<p>In order to add some security to the connection i suggest to prepend the following to the previously added line ( Everything must go in the same line )</p>
<pre style="padding-left: 30px;">from="ip_of_backup_server",no-agent-forwarding,no-port-forwarding,no-pty,no-user-rc,no-X11-forwarding</pre>
<p>The entire line should look <span style="text-decoration: underline;">like</span> the following after the mod:</p>
<pre style="padding-left: 30px;">from="ip_of_backup_server",no-agent-forwarding,no-port-forwarding,no-pty,no-user-rc,no-X11-forwarding ssh-rsa AAAAB3NzaC.......NbPjH veke@backupserver</pre>
<p>This will restrict the incoming connections only from the specified ip ( You can also specify the hostname there ) and it will disable some unnecessary stuff.</p>
<p>Since from my backup server I want to backup files owned by root I need the &#8220;backupper&#8221; user to be in sudoers file. Then open up your /etc/sudoers file in the backup server and add the following:</p>
<pre style="padding-left: 30px;">backupper ALL= NOPASSWD: /usr/bin/rsync</pre>
<p>Using this trick we&#8217;ll let the backupper user to run sudo only if he needs to execute the rsync binary.</p>
<p>In order to make things easier lets create ~/.ssh/config file in the Backup Server.</p>
<pre style="padding-left: 30px;">Host client1
HostName client1.tobackup.com
Port 22
IdentityFile ~/.ssh/rsynckey</pre>
<p>This will simplify us the life afterwards while configuring rsnapshot. If you want to test that everything is setted up correctly just fire in the backup server</p>
<pre style="padding-left: 30px;">veke@backupserver:~/$ ssh backupper@client1
PTY allocation request failed on channel 0</pre>
<p>It could sound like an error message but it&#8217;s not! Infact if you get that response that will mean:</p>
<ul>
<li>The public/private key is setted up correctly</li>
<li>The config file is setted up correctly</li>
<li>You restricted the key to not have the pty ( Correct since we won&#8217;t use it )</li>
</ul>
<p>If you get a Password prompt that means that something went wrong. Double check the previous steps!</p>
<h3>Setting up rsnapshot</h3>
<p>Why rsnapshot? Well, cause it&#8217;s perfect. It does perfectly handle my situation and it also save some disk space on your backup server using hard links instead of doing each time a full copy ( You&#8217;ll also save bandwidth ).</p>
<p>In order to set up rsnapshot correctly you&#8217;ll only have to install some goodies.</p>
<p>On both backup server and the web server install rsync:</p>
<pre style="padding-left: 30px;">sudo apt-get install rsync</pre>
<p>(Backup server only) install rsnapshot</p>
<pre style="padding-left: 30px;">sudo apt-get install rsnapshot</pre>
<p><span style="text-decoration: underline;">From now on all the stuff will need to be done on the backup server only.</span></p>
<p>Like every good tool rsnapshot has a config file. We need to create a config file that will define a couple of things. <strong>Remember</strong>: TABS must separate all &#8220;columns&#8221;<br />
<div id="gist-2463938" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'>config_version	1.2</div><div class='line' id='LC2'>snapshot_root	/your/backup/folder/</div><div class='line' id='LC3'>cmd_rsync	/usr/bin/rsync</div><div class='line' id='LC4'>cmd_ssh	/usr/bin/ssh</div><div class='line' id='LC5'>cmd_cp	/bin/cp</div><div class='line' id='LC6'>cmd_rm	/bin/rm</div><div class='line' id='LC7'>cmd_logger	/usr/bin/logger</div><div class='line' id='LC8'>cmd_du	/usr/bin/du</div><div class='line' id='LC9'>retain	daily	7</div><div class='line' id='LC10'>retain	weekly	7</div><div class='line' id='LC11'>retain	monthly	3</div><div class='line' id='LC12'>#client1 backups</div><div class='line' id='LC13'>backup	backupper@client1:/home/backupper/mysqlbackups	client1/</div><div class='line' id='LC14'>backup	backupper@client1:/etc	client1/	+rsync_long_args=--rsync-path=&#39;sudo rsync&#39;</div><div class='line' id='LC15'>backup	backupper@client1:/var/www	client1/	+rsync_long_args=--exclude &#39;/stats/*&#39; --exclude &#39;/log/*&#39; --exclude &#39;/phptmp/*&#39; --exclude &#39;/cache/*&#39; --rsync-path=&#39;sudo rsync&#39;</div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/0c0b86919ea5b4c16557/aac7664ee19d5555a41bd91f6c76c01bc9374624/rsnapshot.conf" style="float:right;">view raw</a>
            <a href="https://gist.github.com/0c0b86919ea5b4c16557#file_rsnapshot.conf" style="float:right;margin-right:10px;color:#666">rsnapshot.conf</a>
            <a href="https://gist.github.com/0c0b86919ea5b4c16557">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>
<br />
In the rsnapshot.conf:</p>
<ul>
<li><strong>line 2</strong>: defines the folder where rsnapshot will write the backups</li>
<li><strong>from line 3 to 8</strong>: we define absolute path to some binaries</li>
<li><strong>from line 9 to 11:</strong>  we define the retain values. This will specify how many backups ( for the specified &#8220;timeframes&#8221; ) we want rsnapshot to &#8220;maintain&#8221;</li>
<li><strong>from line 13 to 15:</strong> we define what to backup.</li>
<ul>
<li><strong>line 13:</strong> we want to backup the folder /home/backupper/mysqlbackups (look at the mysql section above) and we will log in to a host named &#8220;client1&#8243; (look at the ssh section above) using the &#8220;backupper&#8221; user.</li>
<li><strong>line 14</strong>: we want to backup the /etc folder. We also want to run rsync with &#8220;sudo&#8221;</li>
<li><strong>line 15:</strong> we want to backup the /var/www folder. We will also exclude some folders from the backup ( stats, logs, phptmp &#8230; ) since we don&#8217;t want to backup temporary files or logs.</li>
</ul>
</ul>
<p>Now that we&#8217;ve a config file we need to know if everything works. In order to try it just issue the following shell command:</p>
<pre style="padding-left: 30px;">rsnapshot -c /path/to/rsnapshot.conf -t daily</pre>
<p>rsnapshot will read your config file and will echo all the commands that he will fire. &#8220;-t&#8221; specifies &#8220;run in test mode&#8221;. If no errors appear ( like tab errors ) it&#8217;s time to remove the &#8220;-t&#8221; parameter and see if everything works for real.</p>
<p>If everything works great ( could take some time depending on the size of your data ) It&#8217;s time to setup the needed cronjobs. All depends on which &#8220;timeframes&#8221; ( line 9 to 11 ) you use on your config file.  If , for example, you use only the daily timeframe you&#8217;ll only need to setup a daily cronjob.</p>
<pre style="padding-left: 30px;">00 02 * * * rsnapshot -c /path/to/rsnapshot.conf daily</pre>
<p>That will be fired at 2:00 am each day ( remember that if you mysqlbackup your data at 01:00 am  you&#8217;ll need to be sure you download the fresh dumps after that cronjob ended that task ).</p>
<p>Now, the only thing you&#8217;ve to do is to sit and let rsnapshot do the hard job for you!</p>
<h3>Conclusions + Security thoughts</h3>
<p>Rsnapshot + rsync + ssh seems to be a good choice to make incremental and efficient backups. they seems to be robust and well known tools. About security you can even improve the level just by using rssh or tweaking the &#8220;command&#8221; parameter inside the ssh key. In my case the security thoughts adopted and implemented in this howto are enough.</p>
<p>I hope I actually helped someone to setup something cool and fully functional.</p>
<p> <img src='http://www.andreabaccega.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.andreabaccega.com/blog/2012/04/23/how-to-backup-your-web-server-data-rsnapshot-rsync-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android: How to execute some code only on first time the application is launched</title>
		<link>http://www.andreabaccega.com/blog/2012/04/12/android-how-to-execute-some-code-only-on-first-time-the-application-is-launched/</link>
		<comments>http://www.andreabaccega.com/blog/2012/04/12/android-how-to-execute-some-code-only-on-first-time-the-application-is-launched/#comments</comments>
		<pubDate>Thu, 12 Apr 2012 15:12:37 +0000</pubDate>
		<dc:creator>veke87</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[sharedpreferences]]></category>

		<guid isPermaLink="false">http://www.andreabaccega.com/blog/?p=521</guid>
		<description><![CDATA[It happens you need to execute some piece of code only on the first time the user start using your app. Lets say you want to show a quick tutorial to the user just once — Indeed, when the user &#8230; <p><a class="btn small" href="http://www.andreabaccega.com/blog/2012/04/12/android-how-to-execute-some-code-only-on-first-time-the-application-is-launched/">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
			<content:encoded><![CDATA[<p>It happens you need to execute some piece of code only on the first time the user start using your app.</p>
<p>Lets say you want to show a quick tutorial to the user just once — Indeed, when the user open your app for the first time.</p>
<p>Well, an easy solution would be to use a <a href="http://developer.android.com/reference/android/content/SharedPreferences.html">SharedPreference</a> to store the info we need to accomplish this &#8220;task&#8221;.</p>
<p>Below, a snippet with a simple method ( to be included inside your activity class ) that will &#8220;solve&#8221; the problem.</p>
<div id="gist-2367508" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'>	<span class="kd">private</span> <span class="n">Boolean</span> <span class="n">firstTime</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span></div><div class='line' id='LC2'>	<span class="cm">/**</span></div><div class='line' id='LC3'><span class="cm">	 * Checks if the user is opening the app for the first time. </span></div><div class='line' id='LC4'><span class="cm">	 * Note that this method should be placed inside an activity and it can be called multiple times.</span></div><div class='line' id='LC5'><span class="cm">	 * @return boolean</span></div><div class='line' id='LC6'><span class="cm">	 */</span></div><div class='line' id='LC7'>	<span class="kd">private</span> <span class="kt">boolean</span> <span class="nf">isFirstTime</span><span class="o">()</span> <span class="o">{</span></div><div class='line' id='LC8'>		<span class="k">if</span> <span class="o">(</span><span class="n">firstTime</span> <span class="o">==</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span></div><div class='line' id='LC9'>			<span class="n">SharedPreferences</span> <span class="n">mPreferences</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="na">getSharedPreferences</span><span class="o">(</span><span class="s">&quot;first_time&quot;</span><span class="o">,</span> <span class="n">Context</span><span class="o">.</span><span class="na">MODE_PRIVATE</span><span class="o">);</span></div><div class='line' id='LC10'>			<span class="n">firstTime</span> <span class="o">=</span> <span class="n">mPreferences</span><span class="o">.</span><span class="na">getBoolean</span><span class="o">(</span><span class="s">&quot;firstTime&quot;</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span></div><div class='line' id='LC11'>			<span class="k">if</span> <span class="o">(</span><span class="n">firstTime</span><span class="o">)</span> <span class="o">{</span> </div><div class='line' id='LC12'>			    <span class="n">SharedPreferences</span><span class="o">.</span><span class="na">Editor</span> <span class="n">editor</span> <span class="o">=</span> <span class="n">mPreferences</span><span class="o">.</span><span class="na">edit</span><span class="o">();</span></div><div class='line' id='LC13'>			    <span class="n">editor</span><span class="o">.</span><span class="na">putBoolean</span><span class="o">(</span><span class="s">&quot;firstTime&quot;</span><span class="o">,</span> <span class="kc">false</span><span class="o">);</span></div><div class='line' id='LC14'>			    <span class="n">editor</span><span class="o">.</span><span class="na">commit</span><span class="o">();</span></div><div class='line' id='LC15'>			<span class="o">}</span></div><div class='line' id='LC16'>		<span class="o">}</span></div><div class='line' id='LC17'>		<span class="k">return</span> <span class="n">firstTime</span><span class="o">;</span></div><div class='line' id='LC18'>	<span class="o">}</span></div><div class='line' id='LC19'><br/></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/2367508/dbf5dccfc561bcf598b0d4cad450970545313d72/gistfile1.java" style="float:right;">view raw</a>
            <a href="https://gist.github.com/2367508#file_gistfile1.java" style="float:right;margin-right:10px;color:#666">gistfile1.java</a>
            <a href="https://gist.github.com/2367508">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.andreabaccega.com/blog/2012/04/12/android-how-to-execute-some-code-only-on-first-time-the-application-is-launched/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lost password reset software design pattern</title>
		<link>http://www.andreabaccega.com/blog/2012/04/07/lost-password-reset-software-design-pattern/</link>
		<comments>http://www.andreabaccega.com/blog/2012/04/07/lost-password-reset-software-design-pattern/#comments</comments>
		<pubDate>Sat, 07 Apr 2012 13:57:02 +0000</pubDate>
		<dc:creator>veke87</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[password-recovery]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[software design]]></category>

		<guid isPermaLink="false">http://www.andreabaccega.com/blog/?p=510</guid>
		<description><![CDATA[When you build a new Service-Website from scratch you&#8217;ll probably have to face with this. Passwords are the most sensitive data we have and your application should behave securely enough to maintain user&#8217;s data private! Some time ago you it &#8230; <p><a class="btn small" href="http://www.andreabaccega.com/blog/2012/04/07/lost-password-reset-software-design-pattern/">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-513" title="terminale-password[1]" src="http://www.andreabaccega.com/blog/files/2012/04/terminale-password1.png" alt="" width="336" height="290" /></p>
<p>When you build a new Service-Website from scratch you&#8217;ll probably have to face with this. Passwords <strong>are the most sensitive data</strong> we have and your application should behave securely enough to maintain user&#8217;s data private!</p>
<p>Some time ago you it was a common pattern to store the user password as plain text ( or with some <a href="http://en.wikipedia.org/wiki/Symmetric-key_algorithm">Symmetric-key</a> algorithm ). This let the user to retrieve their password withouth setting a new one.</p>
<p>From this pattern a fork was born which required to answer a predefined question in order to make the application send the password back to the user.</p>
<p>It seems these patterns are not used anymore in favor of the actual one which involves a more structured application/user flow in order to let the user regain access to the application. I&#8217;m talking about password reset.</p>
<h3>The new way</h3>
<p><span id="more-510"></span></p>
<p>Basically the password is stored in the database with a non symmetric-key algorithm ( Ex: md5 hash ) and whenever the user needs to regain access to the application the password needs to be resetted ( and the old one will be lost forever ).</p>
<p>Everything starts when the user can&#8217;t find his password to access your application. Then the user needs to remind the email or the username he used to login into your application, once this is done he needs to fill in the &#8220;Password reset form&#8221; which will ask only for the username.</p>
<p>The application, at this point, will generate a new token and save it inside the database for later usage. The user then receives the  notification from the server ( usually via e-mail ) that contains a string like the following:</p>
<blockquote>
<p style="padding-left: 30px;">Hey, we heard you lost your password.</p>
<p style="padding-left: 30px;">Use the following link within the next 24 hours to reset your password:</p>
<p style="padding-left: 30px;">https://example.com/resetpassword/<strong><em>&lt;username&gt;</em></strong>/<strong><em>&lt;token&gt;</em></strong></p>
<p style="padding-left: 30px;">Thanks,</p>
</blockquote>
<p>When the user clicks over the link the application needs to validate a couple of things:</p>
<ul>
<li>Is the username/token pair a valid one?</li>
<li>Is the token still valid ( not expired ? )</li>
<li>Was the token already used ?</li>
</ul>
<div>If every above-mentioned check goes the way it should, then the user can log-in your application again. How? There are two options here:</div>
<div>
<ul>
<li>Make the user choose the new password after your application validates the link</li>
<li>Send the user a new automatically generated password via email.</li>
</ul>
<div>The first option <strong>seems</strong> to be more secure than the second one ( think about if your email account get hacked and the attacker starts searching for &#8220;password&#8221; inside the user&#8217;s archived emails ).</div>
<div></div>
</div>
<div>In order to explain the procedure i designed a quick flow chart.</div>
<p><a href="http://www.andreabaccega.com/blog/files/2012/04/recover-password2.png"><img class="box aligncenter" title="Last-" src="http://www.andreabaccega.com/blog/files/2012/04/recover-password2.png" alt="" width="739" height="1191" /></a></p>
<p>I also designed a database-table schema for storing/retrieving the token informations.</p>
<div id="gist-2328838" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="k">CREATE</span> <span class="k">TABLE</span> <span class="n">IF</span> <span class="k">NOT</span> <span class="k">EXISTS</span> <span class="o">`</span><span class="n">resetpasswordtokens</span><span class="o">`</span> <span class="p">(</span></div><div class='line' id='LC2'>&nbsp;&nbsp;<span class="o">`</span><span class="n">id</span><span class="o">`</span> <span class="nb">int</span><span class="p">(</span><span class="mi">11</span><span class="p">)</span> <span class="k">NOT</span> <span class="k">NULL</span> <span class="n">AUTO_INCREMENT</span><span class="p">,</span></div><div class='line' id='LC3'>&nbsp;&nbsp;<span class="o">`</span><span class="n">userID</span><span class="o">`</span> <span class="nb">int</span><span class="p">(</span><span class="mi">11</span><span class="p">)</span> <span class="k">NOT</span> <span class="k">NULL</span><span class="p">,</span></div><div class='line' id='LC4'>&nbsp;&nbsp;<span class="o">`</span><span class="n">token</span><span class="o">`</span> <span class="nb">char</span><span class="p">(</span><span class="mi">32</span><span class="p">)</span> <span class="k">NOT</span> <span class="k">NULL</span><span class="p">,</span></div><div class='line' id='LC5'>&nbsp;&nbsp;<span class="o">`</span><span class="n">status</span><span class="o">`</span> <span class="k">set</span><span class="p">(</span><span class="s1">&#39;used&#39;</span><span class="p">,</span><span class="s1">&#39;new&#39;</span><span class="p">)</span> <span class="k">NOT</span> <span class="k">NULL</span> <span class="k">DEFAULT</span> <span class="s1">&#39;new&#39;</span><span class="p">,</span></div><div class='line' id='LC6'>&nbsp;&nbsp;<span class="o">`</span><span class="nb">date</span><span class="o">`</span> <span class="k">timestamp</span> <span class="k">NOT</span> <span class="k">NULL</span> <span class="k">DEFAULT</span> <span class="k">CURRENT_TIMESTAMP</span><span class="p">,</span></div><div class='line' id='LC7'>&nbsp;&nbsp;<span class="k">PRIMARY</span> <span class="k">KEY</span> <span class="p">(</span><span class="o">`</span><span class="n">id</span><span class="o">`</span><span class="p">),</span></div><div class='line' id='LC8'>&nbsp;&nbsp;<span class="k">KEY</span> <span class="o">`</span><span class="n">userID</span><span class="o">`</span> <span class="p">(</span><span class="o">`</span><span class="n">userID</span><span class="o">`</span><span class="p">)</span></div><div class='line' id='LC9'><span class="p">)</span> <span class="n">ENGINE</span><span class="o">=</span><span class="n">MyISAM</span> <span class="k">DEFAULT</span> <span class="n">CHARSET</span><span class="o">=</span><span class="n">latin1</span> <span class="n">AUTO_INCREMENT</span><span class="o">=</span><span class="mi">1</span> <span class="p">;</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/2328838/0f7646302095e59b51b1505ebd248465fb2c9357/gistfile1.sql" style="float:right;">view raw</a>
            <a href="https://gist.github.com/2328838#file_gistfile1.sql" style="float:right;margin-right:10px;color:#666">gistfile1.sql</a>
            <a href="https://gist.github.com/2328838">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>I hope this helps <img src='http://www.andreabaccega.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.andreabaccega.com/blog/2012/04/07/lost-password-reset-software-design-pattern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Serve landing page while building a new wordpress site</title>
		<link>http://www.andreabaccega.com/blog/2012/04/05/serve-landing-page-while-building-a-new-wordpress-site/</link>
		<comments>http://www.andreabaccega.com/blog/2012/04/05/serve-landing-page-while-building-a-new-wordpress-site/#comments</comments>
		<pubDate>Thu, 05 Apr 2012 21:34:53 +0000</pubDate>
		<dc:creator>veke87</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[development-production]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.andreabaccega.com/blog/?p=507</guid>
		<description><![CDATA[If you&#8217;re a web developer you confronted by this at least once. If you don&#8217;t own a development webserver you&#8217;ll need to make your developments in the production webserver. This means that everyone could see your work-in-progress easily. A common &#8230; <p><a class="btn small" href="http://www.andreabaccega.com/blog/2012/04/05/serve-landing-page-while-building-a-new-wordpress-site/">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-508" title="htaccess[1]" src="http://www.andreabaccega.com/blog/files/2012/04/htaccess1.jpg" alt="" width="511" height="157" />If you&#8217;re a web developer you confronted by this at least once. If you don&#8217;t own a development webserver you&#8217;ll need to make your developments in the production webserver. This means that everyone could see your work-in-progress easily.</p>
<p>A common pattern is to create an index.html file ( which gets served &#8211; almost ever &#8211; before index.php ) which will contain a specific landing page with an &#8220;under construction&#8221; text.</p>
<p>How to serve the index.html file to &#8220;regular people&#8221; while you work on wordpress ( index.php ) ?</p>
<p>It&#8217;s quite easy using .htaccess and mod_rewrite of apache. The basic concepts are:</p>
<ul>
<li>WordPress logged in people will see the &#8220;work in progress&#8221; website</li>
<li>Not logged in people will see the &#8220;site under construction&#8221; page</li>
</ul>
<p>In order to achieve that, you&#8217;ve to prepend the following lines to your .htaccess file  ( placed in your document root ) :</p>
<blockquote>
<pre>&lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} index.html$
  RewriteCond %{HTTP_COOKIE} ^.*wordpress_logged_in.*$ [NC]
  RewriteRule . /index.php [L]
&lt;/IfModule&gt;</pre>
</blockquote>
<p>As you can see we only override the normal web-flow <strong>only if</strong> the browser is going to request the index.html file and the user has the <strong>wordpress_logged_in</strong> cookie setted.</p>
<p>Whenever you need to see your &#8220;real website&#8221; you just need to point your browser to http://example.com/wp-admin , login and then you&#8217;ll be able to see the website you&#8217;re creating and not the &#8220;under construction&#8221; page.</p>
<p><strong>Note</strong>: This is only a partial solution and people could be smart enough to emulate the wordpress_logged_in cookie and see your work in progress anyway. In my case-scenarios this was more than enough.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andreabaccega.com/blog/2012/04/05/serve-landing-page-while-building-a-new-wordpress-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Avoiding Xss injection without sacrifying some tags in PHP</title>
		<link>http://www.andreabaccega.com/blog/2012/03/23/avoiding-xss-injection-without-sacrifying-some-tags-in-php/</link>
		<comments>http://www.andreabaccega.com/blog/2012/03/23/avoiding-xss-injection-without-sacrifying-some-tags-in-php/#comments</comments>
		<pubDate>Fri, 23 Mar 2012 21:37:23 +0000</pubDate>
		<dc:creator>veke87</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[data sanitization]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[xss]]></category>

		<guid isPermaLink="false">http://www.andreabaccega.com/blog/?p=497</guid>
		<description><![CDATA[Sooner or later I always remember I&#8217;ve a blog. This time the topic is XSS. If you don&#8217;t have a clue of what XSS is maybe you should read this before reading this article. I&#8217;m my day-job the content is generated &#8230; <p><a class="btn small" href="http://www.andreabaccega.com/blog/2012/03/23/avoiding-xss-injection-without-sacrifying-some-tags-in-php/">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-498" title="xss[1]" src="http://www.andreabaccega.com/blog/files/2012/03/xss1.png" alt="" width="600" height="400" /></p>
<p>Sooner or later I always remember I&#8217;ve a blog. This time the topic is <acronym title="Cross Site Scripting">XSS</acronym>.</p>
<p>If you don&#8217;t have a clue of what XSS is maybe you should <a href="http://it.wikipedia.org/wiki/Cross-site_scripting">read this</a> before reading this article.</p>
<p><span id="more-497"></span></p>
<p>I&#8217;m my day-job the content is generated by third party people. In order to be save I always thought the strip_tags function from PHP was safe enough. In my case I needed to get some html tags working without letting malicious code pass through.</p>
<p>Fortunately strip_tags allows, as second parameter, to specify which tags are allowed. But here is the glitch:</p>
<div id="gist-2509477" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="cp">&lt;?php</span></div><div class='line' id='LC2'>&nbsp;&nbsp;&nbsp;<span class="nb">strip_tags</span><span class="p">(</span><span class="nv">$toStrip</span><span class="p">,</span> <span class="s1">&#39;&lt;p&gt;&lt;a&gt;&lt;b&gt;&lt;i&gt;&lt;em&gt;&lt;u&gt;&lt;ul&gt;&lt;li&gt;&lt;ol&gt;&lt;span&gt;&lt;div&gt;&#39;</span><span class="p">)</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/2509477/dfd8f281869064304cac214e3103d9ba3c8b8906/snippet_stiptags.php" style="float:right;">view raw</a>
            <a href="https://gist.github.com/2509477#file_snippet_stiptags.php" style="float:right;margin-right:10px;color:#666">snippet_stiptags.php</a>
            <a href="https://gist.github.com/2509477">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>What happens if the variable you&#8217;d like to strip contains something like this ?</p>
<div id="gist-2509477" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="nt">&lt;a</span> <span class="na">href=</span><span class="s">&#39;http://www.example.com&#39;</span> <span class="na">onClick=</span><span class="s">&#39;javascript:alert(&quot;blabla&quot;);&#39;</span><span class="nt">&gt;</span>Click Me!<span class="nt">&lt;/a&gt;</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/2509477/2f5bee5109662fffc8fca31a6d9be98b13584e69/snippet_example_a.html" style="float:right;">view raw</a>
            <a href="https://gist.github.com/2509477#file_snippet_example_a.html" style="float:right;margin-right:10px;color:#666">snippet_example_a.html</a>
            <a href="https://gist.github.com/2509477">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>Well, since the &#8216;a&#8217; tag is allowed by our strip_tags call, the malicious code gets injected.</p>
<p>So here is what I discovered today: <em>&#8220;strip_tags is not safe enough.&#8221;</em></p>
<p>The next question that popped in my mind was: &#8220;<em>How to get strip_tags safe enough without adding any external library to the project?</em>&#8220;</p>
<p>Well the easy solution was to strip away also html attributes ( since in my case those weren&#8217;t needed ). How to do that? This snippet of code worked ( for now ) for me.</p>
<div id="gist-2509477" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="cp">&lt;?php</span></div><div class='line' id='LC2'><span class="o">/*</span></div><div class='line' id='LC3'><span class="o">*</span> <span class="nx">Allow</span> <span class="nx">only</span> <span class="nx">a</span> <span class="nx">couple</span> <span class="nx">of</span> <span class="nx">tags</span> <span class="o">+</span> <span class="nx">Strip</span> <span class="nx">Slashes</span> <span class="o">+</span> <span class="nx">Remove</span> <span class="nx">any</span> <span class="nx">attribute</span></div><div class='line' id='LC4'><span class="o">*</span> <span class="o">/</span></div><div class='line' id='LC5'><span class="nv">$almostSafeOutput</span> <span class="o">=</span> <span class="nb">preg_replace</span><span class="p">(</span></div><div class='line' id='LC6'>	<span class="s2">&quot;/&lt;([a-z][a-z0-9]*)[^&gt;]*?(\/?)&gt;/i&quot;</span><span class="p">,</span></div><div class='line' id='LC7'>	<span class="s1">&#39;&lt;$1$2&gt;&#39;</span><span class="p">,</span> </div><div class='line' id='LC8'>	<span class="nb">stripslashes</span><span class="p">(</span></div><div class='line' id='LC9'>		<span class="nb">strip_tags</span><span class="p">(</span></div><div class='line' id='LC10'>			<span class="nv">$toStrip</span><span class="p">,</span> </div><div class='line' id='LC11'>			<span class="s1">&#39;&lt;p&gt;&lt;a&gt;&lt;b&gt;&lt;i&gt;&lt;em&gt;&lt;u&gt;&lt;ul&gt;&lt;li&gt;&lt;ol&gt;&lt;span&gt;&lt;div&gt;&#39;</span></div><div class='line' id='LC12'>		<span class="p">)</span></div><div class='line' id='LC13'>	<span class="p">)</span></div><div class='line' id='LC14'><span class="p">);</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/2509477/054b4c11413aaeec44488f38a023f6bf4713d4cc/snippet_solution.php" style="float:right;">view raw</a>
            <a href="https://gist.github.com/2509477#file_snippet_solution.php" style="float:right;margin-right:10px;color:#666">snippet_solution.php</a>
            <a href="https://gist.github.com/2509477">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>Further readings:</p>
<ul>
<li><a href="http://it.wikipedia.org/wiki/Cross-site_scripting">http://it.wikipedia.org/wiki/Cross-site_scripting</a></li>
<li><a href="https://www.owasp.org/index.php/Cross-site_Scripting_(XSS)">https://www.owasp.org/index.php/Cross-site_Scripting_(XSS)</a></li>
<li><a href="https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet">https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet</a></li>
</ul>
<p style="padding-left: 30px;">
]]></content:encoded>
			<wfw:commentRss>http://www.andreabaccega.com/blog/2012/03/23/avoiding-xss-injection-without-sacrifying-some-tags-in-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>onChange event on EditText in Android</title>
		<link>http://www.andreabaccega.com/blog/2010/10/09/onchange-event-on-edittext-in-android/</link>
		<comments>http://www.andreabaccega.com/blog/2010/10/09/onchange-event-on-edittext-in-android/#comments</comments>
		<pubDate>Sat, 09 Oct 2010 12:30:09 +0000</pubDate>
		<dc:creator>veke87</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[edittext]]></category>

		<guid isPermaLink="false">http://www.andreabaccega.com/?p=470</guid>
		<description><![CDATA[Sooner or later you&#8217;ll have to deal with it. If you&#8217;re an html developer and you write also in javascript you&#8217;ll surely know the onchange event. Unfortunately it&#8217;s a little bit tricky to find the same event on android. The &#8230; <p><a class="btn small" href="http://www.andreabaccega.com/blog/2010/10/09/onchange-event-on-edittext-in-android/">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
			<content:encoded><![CDATA[<p>Sooner or later you&#8217;ll have to deal with it. If you&#8217;re an html developer and you write also in javascript you&#8217;ll surely know the onchange event.</p>
<p>Unfortunately it&#8217;s a little bit tricky to find the same event on android.</p>
<p>The onChange event is helpful when you&#8217;ve to deal with the following things:</p>
<ul>
<li>Let the user know (in realtime) how many characters he typed.</li>
<li>Let the user know (in realtime) how many remaining characters he is allowed to type.</li>
<li>Make realtime processing of the content ( like sending it online and fetch some partial results of the partial typed edittext )</li>
</ul>
<p>You&#8217;ve to implement your own instance of TextWatcher and let the edittext know that you want to be notified at each change by calling the method EditText.addTextChangedListener.</p>
<p>Below i will give you a simple example ( it&#8217;s written on the fly but you&#8217;ll understand the idea )</p>
<pre class="brush: java; title: ; notranslate">
			((EditText)findViewById(R.id.et_testo)).addTextChangedListener(new TextWatcher() {

			public void afterTextChanged(Editable s) {
				((TextView)findViewById(R.id.numcaratteri)).setText(String.format(getString(R.string.caratteri), s.length()));

			}

			public void beforeTextChanged(CharSequence s, int start, int count,
					int after) {
				// TODO Auto-generated method stub

			}

			public void onTextChanged(CharSequence s, int start, int before,
					int count) {
				// TODO Auto-generated method stub

			}

		});
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.andreabaccega.com/blog/2010/10/09/onchange-event-on-edittext-in-android/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Android Root Certification Authorities List</title>
		<link>http://www.andreabaccega.com/blog/2010/09/23/android-root-certification-authorities-list/</link>
		<comments>http://www.andreabaccega.com/blog/2010/09/23/android-root-certification-authorities-list/#comments</comments>
		<pubDate>Thu, 23 Sep 2010 09:59:19 +0000</pubDate>
		<dc:creator>veke87</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://www.andreabaccega.com/?p=459</guid>
		<description><![CDATA[Since it was a little hard for me finding it, here you can find the trusted CAs in Android 2.2 Froyo. In order to get my result on each android device you&#8217;ve to download this file and place it on &#8230; <p><a class="btn small" href="http://www.andreabaccega.com/blog/2010/09/23/android-root-certification-authorities-list/">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
			<content:encoded><![CDATA[<p>Since it was a little hard for me finding it, here you can find the trusted CAs in Android 2.2 Froyo.</p>
<p>In order to get my result on each android device you&#8217;ve to download <a href="http://bouncycastle.org/download/bcprov-jdk16-141.jar"> this file</a> and place it on $JAVA_HOME/lib/ext . Plus, you should have $JAVA_HOME/bin in your $PATH</p>
<pre class="brush: bash; title: ; notranslate">
adb pull /system/etc/security/cacerts.bks cacerts.bks
keystore cacerts.bks -storetype BKS -provider org.bouncycastle.jce.provider.BouncyCastleProvider -storepass changeit -list -v &gt;&gt; certificates.txt
</pre>
<p>After the break my certificates.txt.<br />
<span id="more-459"></span></p>
<pre>

Keystore type: BKS
Keystore provider: BC

Your keystore contains 57 entries

Alias name: 29
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=US,O=VeriSign\, Inc.,OU=Class 3 Public Primary Certification Authority
Issuer: C=US,O=VeriSign\, Inc.,OU=Class 3 Public Primary Certification Authority
Serial number: 70bae41d10d92934b638ca7b03ccbabf
Valid from: Mon Jan 29 01:00:00 CET 1996 until: Wed Aug 02 01:59:59 CEST 2028
Certificate fingerprints:
	 MD5:  10:FC:63:5D:F6:26:3E:0D:F3:25:BE:5F:79:CD:67:67
	 SHA1: 74:2C:31:92:E6:07:E4:24:EB:45:49:54:2B:E1:BB:C5:3E:61:74:E2
	 Signature algorithm name: MD2WithRSAEncryption
	 Version: 1

*******************************************
*******************************************

Alias name: 28
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=US,O=Equifax Secure Inc.,CN=Equifax Secure Global eBusiness CA-1
Issuer: C=US,O=Equifax Secure Inc.,CN=Equifax Secure Global eBusiness CA-1
Serial number: 1
Valid from: Mon Jun 21 06:00:00 CEST 1999 until: Sun Jun 21 06:00:00 CEST 2020
Certificate fingerprints:
	 MD5:  8F:5D:77:06:27:C4:98:3C:5B:93:78:E7:D7:7D:9B:CC
	 SHA1: 7E:78:4A:10:1C:82:65:CC:2D:E1:F1:6D:47:B4:40:CA:D9:0A:19:45
	 Signature algorithm name: MD5WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 27
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=US,O=VeriSign\, Inc.,OU=Class 3 Public Primary Certification Authority - G2,OU=(c) 1998 VeriSign\, Inc. - For authorized use only,OU=VeriSign Trust Network
Issuer: C=US,O=VeriSign\, Inc.,OU=Class 3 Public Primary Certification Authority - G2,OU=(c) 1998 VeriSign\, Inc. - For authorized use only,OU=VeriSign Trust Network
Serial number: 7dd9fe07cfa81eb7107967fba78934c6
Valid from: Mon May 18 02:00:00 CEST 1998 until: Wed Aug 02 01:59:59 CEST 2028
Certificate fingerprints:
	 MD5:  A2:33:9B:4C:74:78:73:D4:6C:E7:C1:F3:8D:CB:5C:E9
	 SHA1: 85:37:1C:A6:E5:50:14:3D:CE:28:03:47:1B:DE:3A:09:E8:F8:77:0F
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 1

*******************************************
*******************************************

Alias name: 26
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=IL,O=StartCom Ltd.,OU=StartCom Certification Authority,CN=StartCom Extended Validation Server CA
Issuer: C=IL,O=StartCom Ltd.,OU=Secure Digital Certificate Signing,CN=StartCom Certification Authority
Serial number: 17
Valid from: Thu Jan 01 07:00:00 CET 2009 until: Tue Jan 01 07:00:00 CET 2019
Certificate fingerprints:
	 MD5:  01:D3:0C:7E:B6:FB:E9:EF:80:F5:9D:47:BB:F4:5F:27
	 SHA1: 65:73:55:A6:BB:68:F9:3D:33:CC:B7:58:B4:2F:5E:1A:7D:85:C9:C4
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 25
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=PL,O=Unizeto Sp. z o.o.,CN=Certum CA
Issuer: C=PL,O=Unizeto Sp. z o.o.,CN=Certum CA
Serial number: 10020
Valid from: Tue Jun 11 12:46:39 CEST 2002 until: Fri Jun 11 12:46:39 CEST 2027
Certificate fingerprints:
	 MD5:  2C:8F:9F:66:1D:18:90:B1:47:26:9D:8E:86:82:8C:A9
	 SHA1: 62:52:DC:40:F7:11:43:A2:2F:DE:9E:F7:34:8E:06:42:51:B1:81:18
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 24
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert Assured ID Root CA
Issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert Assured ID Root CA
Serial number: ce7e0e517d846fe8fe560fc1bf03039
Valid from: Fri Nov 10 01:00:00 CET 2006 until: Mon Nov 10 01:00:00 CET 2031
Certificate fingerprints:
	 MD5:  87:CE:0B:7B:2A:0E:49:00:E1:58:71:9B:37:A8:93:72
	 SHA1: 05:63:B8:63:0D:62:D7:5A:BB:C8:AB:1E:4B:DF:B5:A8:99:B2:4D:43
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 56
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: O=VeriSign Trust Network,OU=VeriSign\, Inc.,OU=VeriSign International Server CA - Class 3,OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign
Issuer: C=US,O=VeriSign\, Inc.,OU=Class 3 Public Primary Certification Authority
Serial number: 46fcebbab4d02f0f926098233f93078f
Valid from: Thu Apr 17 02:00:00 CEST 1997 until: Tue Oct 25 01:59:59 CEST 2016
Certificate fingerprints:
	 MD5:  AC:D8:0E:A2:7B:B7:2C:E7:00:DC:22:72:4A:5F:1E:92
	 SHA1: D5:59:A5:86:66:9B:08:F4:6A:30:A1:33:F8:A9:ED:3D:03:8E:2E:A8
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 23
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=HU,L=Budapest,O=NetLock Halozatbiztonsagi Kft.,OU=Tanusitvanykiadok,CN=NetLock Expressz (Class C) Tanusitvanykiado
Issuer: C=HU,L=Budapest,O=NetLock Halozatbiztonsagi Kft.,OU=Tanusitvanykiadok,CN=NetLock Expressz (Class C) Tanusitvanykiado
Serial number: 68
Valid from: Thu Feb 25 15:08:11 CET 1999 until: Wed Feb 20 15:08:11 CET 2019
Certificate fingerprints:
	 MD5:  4F:EB:F1:F0:70:C2:80:63:5D:58:9F:DA:12:3C:A9:C4
	 SHA1: E3:92:51:2F:0A:CF:F5:05:DF:F6:DE:06:7F:75:37:E1:65:EA:57:4B
	 Signature algorithm name: MD5WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 55
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=US,ST=UT,L=Salt Lake City,O=The USERTRUST Network,OU=http://www.usertrust.com,CN=UTN-USERFirst-Hardware
Issuer: C=US,ST=UT,L=Salt Lake City,O=The USERTRUST Network,OU=http://www.usertrust.com,CN=UTN-USERFirst-Hardware
Serial number: 44be0c8b500024b411d3362afe650afd
Valid from: Fri Jul 09 20:10:42 CEST 1999 until: Tue Jul 09 20:19:22 CEST 2019
Certificate fingerprints:
	 MD5:  4C:56:41:E5:0D:BB:2B:E8:CA:A3:ED:18:08:AD:43:39
	 SHA1: 04:83:ED:33:99:AC:36:08:05:87:22:ED:BC:5E:46:00:E3:BE:F9:D7
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 22
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=BM,O=QuoVadis Limited,OU=Root Certification Authority,CN=QuoVadis Root Certification Authority
Issuer: C=BM,O=QuoVadis Limited,OU=Root Certification Authority,CN=QuoVadis Root Certification Authority
Serial number: 3ab6508b
Valid from: Mon Mar 19 19:33:33 CET 2001 until: Wed Mar 17 19:33:33 CET 2021
Certificate fingerprints:
	 MD5:  27:DE:36:FE:72:B7:00:03:00:9D:F4:F0:1E:6C:04:24
	 SHA1: DE:3F:40:BD:50:93:D3:9B:6C:60:F6:DA:BC:07:62:01:00:89:76:C9
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 54
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=US,O=VeriSign\, Inc.,OU=VeriSign Trust Network,OU=(c) 2006 VeriSign\, Inc. - For authorized use only,CN=VeriSign Class 3 Public Primary Certification Authority - G5
Issuer: C=US,O=VeriSign\, Inc.,OU=VeriSign Trust Network,OU=(c) 2006 VeriSign\, Inc. - For authorized use only,CN=VeriSign Class 3 Public Primary Certification Authority - G5
Serial number: 18dad19e267de8bb4a2158cdcc6b3b4a
Valid from: Wed Nov 08 01:00:00 CET 2006 until: Thu Jul 17 01:59:59 CEST 2036
Certificate fingerprints:
	 MD5:  CB:17:E4:31:67:3E:E2:09:FE:45:57:93:F3:0A:FA:1C
	 SHA1: 4E:B6:D5:78:49:9B:1C:CF:5F:58:1E:AD:56:BE:3D:9B:67:44:A5:E5
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 21
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=HU,L=Budapest,O=NetLock Halozatbiztonsagi Kft.,OU=Tanusitvanykiadok,CN=NetLock Uzleti (Class B) Tanusitvanykiado
Issuer: C=HU,L=Budapest,O=NetLock Halozatbiztonsagi Kft.,OU=Tanusitvanykiadok,CN=NetLock Uzleti (Class B) Tanusitvanykiado
Serial number: 69
Valid from: Thu Feb 25 15:10:22 CET 1999 until: Wed Feb 20 15:10:22 CET 2019
Certificate fingerprints:
	 MD5:  39:16:AA:B9:6A:41:E1:14:69:DF:9E:6C:3B:72:DC:B6
	 SHA1: 87:9F:4B:EE:05:DF:98:58:3B:E3:60:D6:33:E7:0D:3F:FE:98:71:AF
	 Signature algorithm name: MD5WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 53
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: L=ValiCert Validation Network,O=ValiCert\, Inc.,OU=ValiCert Class 1 Policy Validation Authority,CN=http://www.valicert.com/,E=info@valicert.com
Issuer: L=ValiCert Validation Network,O=ValiCert\, Inc.,OU=ValiCert Class 1 Policy Validation Authority,CN=http://www.valicert.com/,E=info@valicert.com
Serial number: 1
Valid from: Sat Jun 26 00:23:48 CEST 1999 until: Wed Jun 26 00:23:48 CEST 2019
Certificate fingerprints:
	 MD5:  65:58:AB:15:AD:57:6C:1E:A8:A7:B5:69:AC:BF:FF:EB
	 SHA1: E5:DF:74:3C:B6:01:C4:9B:98:43:DC:AB:8C:E8:6A:81:10:9F:E4:8E
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 1

*******************************************
*******************************************

Alias name: 20
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=US,O=Equifax,OU=Equifax Secure Certificate Authority
Issuer: C=US,O=Equifax,OU=Equifax Secure Certificate Authority
Serial number: 35def4cf
Valid from: Sat Aug 22 18:41:51 CEST 1998 until: Wed Aug 22 18:41:51 CEST 2018
Certificate fingerprints:
	 MD5:  67:CB:9D:C0:13:24:8A:82:9B:B2:17:1E:D1:1B:EC:D4
	 SHA1: D2:32:09:AD:23:D3:14:23:21:74:E4:0D:7F:9D:62:13:97:86:63:3A
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 52
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=EU,O=AC Camerfirma SA CIF A82743287,OU=http://www.chambersign.org,CN=Chambers of Commerce Root
Issuer: C=EU,O=AC Camerfirma SA CIF A82743287,OU=http://www.chambersign.org,CN=Chambers of Commerce Root
Serial number: 0
Valid from: Tue Sep 30 18:13:43 CEST 2003 until: Wed Sep 30 18:13:44 CEST 2037
Certificate fingerprints:
	 MD5:  B0:01:EE:14:D9:AF:29:18:94:76:8E:F1:69:33:2A:84
	 SHA1: 6E:3A:55:A4:19:0C:19:5C:93:84:3C:C0:DB:72:2E:31:30:61:F0:B1
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 51
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=US,O=Entrust.net,OU=www.entrust.net/CPS incorp. by ref. (limits liab.),OU=(c) 1999 Entrust.net Limited,CN=Entrust.net Secure Server Certification Authority
Issuer: C=US,O=Entrust.net,OU=www.entrust.net/CPS incorp. by ref. (limits liab.),OU=(c) 1999 Entrust.net Limited,CN=Entrust.net Secure Server Certification Authority
Serial number: 374ad243
Valid from: Tue May 25 18:09:40 CEST 1999 until: Sat May 25 18:39:40 CEST 2019
Certificate fingerprints:
	 MD5:  DF:F2:80:73:CC:F1:E6:61:73:FC:F5:42:E9:C5:7C:EE
	 SHA1: 99:A6:9B:E6:1A:FE:88:6B:4D:2B:82:00:7C:B8:54:FC:31:7E:15:39
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 50
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=US,O=Equifax Secure Inc.,CN=Equifax Secure eBusiness CA-1
Issuer: C=US,O=Equifax Secure Inc.,CN=Equifax Secure eBusiness CA-1
Serial number: 4
Valid from: Mon Jun 21 06:00:00 CEST 1999 until: Sun Jun 21 06:00:00 CEST 2020
Certificate fingerprints:
	 MD5:  64:9C:EF:2E:44:FC:C6:8F:52:07:D0:51:73:8F:CB:3D
	 SHA1: DA:40:18:8B:91:89:A3:ED:EE:AE:DA:97:FE:2F:9D:F5:B7:D1:8A:41
	 Signature algorithm name: MD5WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 9
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=DE,ST=Hamburg,L=Hamburg,O=TC TrustCenter for Security in Data Networks GmbH,OU=TC TrustCenter Class 2 CA,E=certificate@trustcenter.de
Issuer: C=DE,ST=Hamburg,L=Hamburg,O=TC TrustCenter for Security in Data Networks GmbH,OU=TC TrustCenter Class 2 CA,E=certificate@trustcenter.de
Serial number: 3ea
Valid from: Mon Mar 09 12:59:59 CET 1998 until: Sat Jan 01 12:59:59 CET 2011
Certificate fingerprints:
	 MD5:  B8:16:33:4C:4C:4C:F2:D8:D3:4D:06:B4:A6:5B:40:03
	 SHA1: 83:8E:30:F7:7F:DD:14:AA:38:5E:D1:45:00:9C:0E:22:36:49:4F:AA
	 Signature algorithm name: MD5WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 8
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=US,O=Starfield Technologies\, Inc.,OU=Starfield Class 2 Certification Authority
Issuer: C=US,O=Starfield Technologies\, Inc.,OU=Starfield Class 2 Certification Authority
Serial number: 0
Valid from: Tue Jun 29 19:39:16 CEST 2004 until: Thu Jun 29 19:39:16 CEST 2034
Certificate fingerprints:
	 MD5:  32:4A:4B:BB:C8:63:69:9B:BE:74:9A:C6:DD:1D:46:24
	 SHA1: AD:7E:1C:28:B0:64:EF:8F:60:03:40:20:14:C3:D0:E3:37:0E:B5:8A
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 19
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=DE,ST=Hamburg,L=Hamburg,O=TC TrustCenter for Security in Data Networks GmbH,OU=TC TrustCenter Class 3 CA,E=certificate@trustcenter.de
Issuer: C=DE,ST=Hamburg,L=Hamburg,O=TC TrustCenter for Security in Data Networks GmbH,OU=TC TrustCenter Class 3 CA,E=certificate@trustcenter.de
Serial number: 3eb
Valid from: Mon Mar 09 12:59:59 CET 1998 until: Sat Jan 01 12:59:59 CET 2011
Certificate fingerprints:
	 MD5:  5F:94:4A:73:22:B8:F7:D1:31:EC:59:39:F7:8E:FE:6E
	 SHA1: 9F:C7:96:E8:F8:52:4F:86:3A:E1:49:6D:38:12:42:10:5F:1B:78:F5
	 Signature algorithm name: MD5WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 7
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=US,O=The Go Daddy Group\, Inc.,OU=Go Daddy Class 2 Certification Authority
Issuer: C=US,O=The Go Daddy Group\, Inc.,OU=Go Daddy Class 2 Certification Authority
Serial number: 0
Valid from: Tue Jun 29 19:06:20 CEST 2004 until: Thu Jun 29 19:06:20 CEST 2034
Certificate fingerprints:
	 MD5:  91:DE:06:25:AB:DA:FD:32:17:0C:BB:25:17:2A:84:67
	 SHA1: 27:96:BA:E6:3F:18:01:E2:77:26:1B:A0:D7:77:70:02:8F:20:EE:E4
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 18
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=DE,O=TC TrustCenter GmbH,OU=TC TrustCenter Universal CA,CN=TC TrustCenter Universal CA I
Issuer: C=DE,O=TC TrustCenter GmbH,OU=TC TrustCenter Universal CA,CN=TC TrustCenter Universal CA I
Serial number: 1da200010002ecb76080788db606
Valid from: Wed Mar 22 16:54:28 CET 2006 until: Wed Dec 31 23:59:59 CET 2025
Certificate fingerprints:
	 MD5:  45:E1:A5:72:C5:A9:36:64:40:9E:F5:E4:58:84:67:8C
	 SHA1: 6B:2F:34:AD:89:58:BE:62:FD:B0:6B:5C:CE:BB:9D:D9:4F:4E:39:F3
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 6
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=TW,O=Government Root Certification Authority
Issuer: C=TW,O=Government Root Certification Authority
Serial number: 1f9d595ad72fc20644a5800869e35ef6
Valid from: Thu Dec 05 14:23:33 CET 2002 until: Sun Dec 05 14:23:33 CET 2032
Certificate fingerprints:
	 MD5:  37:85:44:53:32:45:1F:20:F0:F3:95:E1:25:C4:43:4E
	 SHA1: F4:8B:11:BF:DE:AB:BE:94:54:20:71:E6:41:DE:6B:BE:88:2B:40:B9
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 17
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=US,ST=UT,L=Salt Lake City,O=The USERTRUST Network,OU=http://www.usertrust.com,CN=UTN - DATACorp SGC
Issuer: C=US,ST=UT,L=Salt Lake City,O=The USERTRUST Network,OU=http://www.usertrust.com,CN=UTN - DATACorp SGC
Serial number: 44be0c8b500021b411d32a6806a9ad69
Valid from: Thu Jun 24 20:57:21 CEST 1999 until: Mon Jun 24 21:06:30 CEST 2019
Certificate fingerprints:
	 MD5:  B3:A5:3E:77:21:6D:AC:4A:C0:C9:FB:D5:41:3D:CA:06
	 SHA1: 58:11:9F:0E:12:82:87:EA:50:FD:D9:87:45:6F:4F:78:DC:FA:D6:D4
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 49
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=ch,O=Swisscom,OU=Digital Certificate Services,CN=Swisscom Root CA 1
Issuer: C=ch,O=Swisscom,OU=Digital Certificate Services,CN=Swisscom Root CA 1
Serial number: 5c0b855c0be75941df57cc3f7f9da836
Valid from: Thu Aug 18 14:06:20 CEST 2005 until: Tue Aug 19 00:06:20 CEST 2025
Certificate fingerprints:
	 MD5:  F8:38:7C:77:88:DF:2C:16:68:2E:C2:E2:52:4B:B8:F9
	 SHA1: 5F:3A:FC:0A:8B:64:F6:86:67:34:74:DF:7E:A9:A2:FE:F9:FA:7A:51
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 5
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=ES,O=FNMT,OU=FNMT Clase 2 CA
Issuer: C=ES,O=FNMT,OU=FNMT Clase 2 CA
Serial number: 36f11b19
Valid from: Thu Mar 18 15:56:19 CET 1999 until: Mon Mar 18 16:26:19 CET 2019
Certificate fingerprints:
	 MD5:  25:9D:CF:5E:B3:25:9D:95:B9:3F:00:86:5F:47:94:3D
	 SHA1: 43:F9:B1:10:D5:BA:FD:48:22:52:31:B0:D0:08:2B:37:2F:EF:9A:54
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 16
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=DE,O=Deutsche Telekom AG,OU=T-TeleSec Trust Center,CN=Deutsche Telekom Root CA 2
Issuer: C=DE,O=Deutsche Telekom AG,OU=T-TeleSec Trust Center,CN=Deutsche Telekom Root CA 2
Serial number: 26
Valid from: Fri Jul 09 14:11:00 CEST 1999 until: Wed Jul 10 01:59:00 CEST 2019
Certificate fingerprints:
	 MD5:  74:01:4A:91:B1:08:C4:58:CE:47:CD:F0:DD:11:53:08
	 SHA1: 85:A4:08:C0:9C:19:3E:5D:51:58:7D:CD:D6:13:30:FD:8C:DE:37:BF
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 48
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=ZA,ST=Western Cape,L=Cape Town,O=Thawte Consulting cc,OU=Certification Services Division,CN=Thawte Server CA,E=server-certs@thawte.com
Issuer: C=ZA,ST=Western Cape,L=Cape Town,O=Thawte Consulting cc,OU=Certification Services Division,CN=Thawte Server CA,E=server-certs@thawte.com
Serial number: 1
Valid from: Thu Aug 01 02:00:00 CEST 1996 until: Fri Jan 01 00:59:59 CET 2021
Certificate fingerprints:
	 MD5:  C5:70:C4:A2:ED:53:78:0C:C8:10:53:81:64:CB:D0:1D
	 SHA1: 23:E5:94:94:51:95:F2:41:48:03:B4:D5:64:D2:A3:A3:F5:D8:8B:8C
	 Signature algorithm name: MD5WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 4
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=US,O=Digital Signature Trust,OU=DST ACES,CN=DST ACES CA X6
Issuer: C=US,O=Digital Signature Trust,OU=DST ACES,CN=DST ACES CA X6
Serial number: d5e990ad69db778ecd807563b8615d9
Valid from: Thu Nov 20 22:19:58 CET 2003 until: Mon Nov 20 22:19:58 CET 2017
Certificate fingerprints:
	 MD5:  21:D8:4C:82:2B:99:09:33:A2:EB:14:24:8D:8E:5F:E8
	 SHA1: 40:54:DA:6F:1C:3F:40:74:AC:ED:0F:EC:CD:DB:79:D1:53:FB:90:1D
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 15
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=US,O=GTE Corporation,OU=GTE CyberTrust Solutions\, Inc.,CN=GTE CyberTrust Global Root
Issuer: C=US,O=GTE Corporation,OU=GTE CyberTrust Solutions\, Inc.,CN=GTE CyberTrust Global Root
Serial number: 1a5
Valid from: Thu Aug 13 02:29:00 CEST 1998 until: Tue Aug 14 01:59:00 CEST 2018
Certificate fingerprints:
	 MD5:  CA:3D:D3:68:F1:03:5C:D0:32:FA:B8:2B:59:E8:5A:DB
	 SHA1: 97:81:79:50:D8:1C:96:70:CC:34:D8:09:CF:79:44:31:36:7E:F4:74
	 Signature algorithm name: MD5WithRSAEncryption
	 Version: 1

*******************************************
*******************************************

Alias name: 47
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=US,ST=UT,L=Salt Lake City,O=The USERTRUST Network,OU=http://www.usertrust.com,CN=UTN-USERFirst-Network Applications
Issuer: C=US,ST=UT,L=Salt Lake City,O=The USERTRUST Network,OU=http://www.usertrust.com,CN=UTN-USERFirst-Network Applications
Serial number: 44be0c8b500024b411d336304bc03377
Valid from: Fri Jul 09 20:48:39 CEST 1999 until: Tue Jul 09 20:57:49 CEST 2019
Certificate fingerprints:
	 MD5:  BF:60:59:A3:5B:BA:F6:A7:76:42:DA:6F:1A:7B:50:CF
	 SHA1: 5D:98:9C:DB:15:96:11:36:51:65:64:1B:56:0F:DB:EA:2A:C2:3E:F1
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 3
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=FR,O=Certplus,CN=Class 2 Primary CA
Issuer: C=FR,O=Certplus,CN=Class 2 Primary CA
Serial number: 85bd4bf3d8dae369f694d75fc3a54423
Valid from: Wed Jul 07 19:05:00 CEST 1999 until: Sun Jul 07 01:59:59 CEST 2019
Certificate fingerprints:
	 MD5:  88:2C:8C:52:B8:A2:3C:F3:F7:BB:03:EA:AE:AC:42:0B
	 SHA1: 74:20:74:41:72:9C:DD:92:EC:79:31:D8:23:10:8D:C2:81:92:E2:BB
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 14
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: O=Entrust.net,OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.),OU=(c) 1999 Entrust.net Limited,CN=Entrust.net Certification Authority (2048)
Issuer: O=Entrust.net,OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.),OU=(c) 1999 Entrust.net Limited,CN=Entrust.net Certification Authority (2048)
Serial number: 3863b966
Valid from: Fri Dec 24 18:50:51 CET 1999 until: Tue Dec 24 19:20:51 CET 2019
Certificate fingerprints:
	 MD5:  BA:21:EA:20:D6:DD:DB:8F:C1:57:8B:40:AD:A1:FC:FC
	 SHA1: 80:1D:62:D0:7B:44:9D:5C:5C:03:5C:98:EA:61:FA:44:3C:2A:58:FE
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 46
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=JP,O=Japan Certification Services\, Inc.,CN=SecureSign RootCA1
Issuer: C=JP,O=Japan Certification Services\, Inc.,CN=SecureSign RootCA1
Serial number: 5f60585f00000000
Valid from: Wed Sep 15 17:00:01 CEST 1999 until: Tue Sep 15 16:59:59 CEST 2020
Certificate fingerprints:
	 MD5:  BD:D6:F5:8A:7C:3C:C4:A6:F9:34:CC:C3:89:61:F6:B2
	 SHA1: CA:BB:51:67:24:00:58:8E:64:19:F1:D4:08:78:D0:40:3A:A2:02:64
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 1

*******************************************
*******************************************

Alias name: 13
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=SE,O=AddTrust AB,OU=AddTrust External TTP Network,CN=AddTrust External CA Root
Issuer: C=SE,O=AddTrust AB,OU=AddTrust External TTP Network,CN=AddTrust External CA Root
Serial number: 1
Valid from: Tue May 30 12:48:38 CEST 2000 until: Sat May 30 12:48:38 CEST 2020
Certificate fingerprints:
	 MD5:  1D:35:54:04:85:78:B0:3F:42:42:4D:BF:20:73:0A:3F
	 SHA1: 02:FA:F3:E2:91:43:54:68:60:78:57:69:4D:F5:E4:5B:68:85:18:68
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 2
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=ES,L=C/ Muntaner 244 Barcelona,CN=Autoridad de Certificacion Firmaprofesional CIF A62634068,E=ca@firmaprofesional.com
Issuer: C=ES,L=C/ Muntaner 244 Barcelona,CN=Autoridad de Certificacion Firmaprofesional CIF A62634068,E=ca@firmaprofesional.com
Serial number: 1
Valid from: Thu Oct 25 00:00:00 CEST 2001 until: Fri Oct 25 00:00:00 CEST 2013
Certificate fingerprints:
	 MD5:  11:92:79:40:3C:B1:83:40:E5:AB:66:4A:67:92:80:DF
	 SHA1: A9:62:8F:4B:98:A9:1B:48:35:BA:D2:C1:46:32:86:BB:66:64:6A:8C
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 45
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=DK,O=TDC Internet,OU=TDC Internet Root CA
Issuer: C=DK,O=TDC Internet,OU=TDC Internet Root CA
Serial number: 3acca54c
Valid from: Thu Apr 05 18:33:17 CEST 2001 until: Mon Apr 05 19:03:17 CEST 2021
Certificate fingerprints:
	 MD5:  91:F4:03:55:20:A1:F8:63:2C:62:DE:AC:FB:61:1C:8E
	 SHA1: 21:FC:BD:8E:7F:6C:AF:05:1B:D1:B3:43:EC:A8:E7:61:47:F2:0F:8A
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 44
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=NL,O=Staat der Nederlanden,CN=Staat der Nederlanden Root CA
Issuer: C=NL,O=Staat der Nederlanden,CN=Staat der Nederlanden Root CA
Serial number: 98968a
Valid from: Tue Dec 17 10:23:49 CET 2002 until: Wed Dec 16 10:15:38 CET 2015
Certificate fingerprints:
	 MD5:  60:84:7C:5A:CE:DB:0C:D4:CB:A7:E9:FE:02:C6:A9:C0
	 SHA1: 10:1D:FA:3F:D5:0B:CB:BB:9B:B5:60:0C:19:55:A4:1A:F4:73:3A:04
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 1
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: OU=GlobalSign Root CA - R2,O=GlobalSign,CN=GlobalSign
Issuer: OU=GlobalSign Root CA - R2,O=GlobalSign,CN=GlobalSign
Serial number: 400000000010f8626e60d
Valid from: Fri Dec 15 09:00:00 CET 2006 until: Wed Dec 15 09:00:00 CET 2021
Certificate fingerprints:
	 MD5:  94:14:77:7E:3E:5E:FD:8F:30:BD:41:B0:CF:E7:D0:30
	 SHA1: 75:E0:AB:B6:13:85:12:27:1C:04:F8:5F:DD:DE:38:E4:B7:24:2E:FE
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 12
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert Global Root CA
Issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert Global Root CA
Serial number: 83be056904246b1a1756ac95991c74a
Valid from: Fri Nov 10 01:00:00 CET 2006 until: Mon Nov 10 01:00:00 CET 2031
Certificate fingerprints:
	 MD5:  79:E4:A9:84:0D:7D:3A:96:D7:C0:4F:E2:43:4C:89:2E
	 SHA1: A8:98:5D:3A:65:E5:E5:C4:B2:D7:D6:6D:40:C6:DD:2F:B1:9C:54:36
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 11
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=IL,O=StartCom Ltd.,OU=Secure Digital Certificate Signing,CN=StartCom Certification Authority
Issuer: C=IL,O=StartCom Ltd.,OU=Secure Digital Certificate Signing,CN=StartCom Certification Authority
Serial number: 1
Valid from: Sun Sep 17 21:46:36 CEST 2006 until: Wed Sep 17 21:46:36 CEST 2036
Certificate fingerprints:
	 MD5:  22:4D:8F:8A:FC:F7:35:C2:BB:57:34:90:7B:8B:22:16
	 SHA1: 3E:2B:F7:F2:03:1B:96:F3:8C:E6:C4:D8:A8:5D:3E:2D:58:47:6A:0F
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 0
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: OU=Copyright (c) 1997 Microsoft Corp.,OU=Microsoft Corporation,CN=Microsoft Root Authority
Issuer: OU=Copyright (c) 1997 Microsoft Corp.,OU=Microsoft Corporation,CN=Microsoft Root Authority
Serial number: c1008b3c3c8811d13ef663ecdf40
Valid from: Fri Jan 10 08:00:00 CET 1997 until: Thu Dec 31 08:00:00 CET 2020
Certificate fingerprints:
	 MD5:  2A:95:4E:CA:79:B2:87:45:73:D9:2D:90:BA:F9:9F:B6
	 SHA1: A4:34:89:15:9A:52:0F:0D:93:D0:32:CC:AF:37:E7:FE:20:A8:B4:19
	 Signature algorithm name: MD5WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 43
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=ZA,ST=Western Cape,L=Cape Town,O=Thawte Consulting cc,OU=Certification Services Division,CN=Thawte Premium Server CA,E=premium-server@thawte.com
Issuer: C=ZA,ST=Western Cape,L=Cape Town,O=Thawte Consulting cc,OU=Certification Services Division,CN=Thawte Premium Server CA,E=premium-server@thawte.com
Serial number: 1
Valid from: Thu Aug 01 02:00:00 CEST 1996 until: Fri Jan 01 00:59:59 CET 2021
Certificate fingerprints:
	 MD5:  06:9F:69:79:16:66:90:02:1B:8C:8C:A2:C3:07:6F:3A
	 SHA1: 62:7F:8D:78:27:65:63:99:D2:7D:7F:90:44:C9:FE:B3:F3:3E:FA:9A
	 Signature algorithm name: MD5WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 10
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=DE,O=TC TrustCenter GmbH,OU=TC TrustCenter Class 2 CA,CN=TC TrustCenter Class 2 CA II
Issuer: C=DE,O=TC TrustCenter GmbH,OU=TC TrustCenter Class 2 CA,CN=TC TrustCenter Class 2 CA II
Serial number: 2e6a000100021fd752212c115c3b
Valid from: Thu Jan 12 15:38:43 CET 2006 until: Wed Dec 31 23:59:59 CET 2025
Certificate fingerprints:
	 MD5:  CE:78:33:5C:59:78:01:6E:18:EA:B9:36:A0:B9:2E:23
	 SHA1: AE:50:83:ED:7C:F4:5C:BC:8F:61:C6:21:FE:68:5D:79:42:21:15:6E
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 42
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=US,O=Entrust\, Inc.,OU=www.entrust.net/CPS is incorporated by reference,OU=(c) 2006 Entrust\, Inc.,CN=Entrust Root Certification Authority
Issuer: C=US,O=Entrust.net,OU=www.entrust.net/CPS incorp. by ref. (limits liab.),OU=(c) 1999 Entrust.net Limited,CN=Entrust.net Secure Server Certification Authority
Serial number: 42872d4c
Valid from: Fri Jan 05 20:20:39 CET 2007 until: Thu Jan 05 20:50:39 CET 2017
Certificate fingerprints:
	 MD5:  59:BF:7B:66:82:BE:87:21:9A:A8:14:A5:32:41:61:82
	 SHA1: BE:E7:72:B3:19:0A:C8:4B:F8:31:F9:60:7D:98:89:EC:6A:96:6C:16
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 41
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=US,O=America Online Inc.,CN=America Online Root Certification Authority 1
Issuer: C=US,O=America Online Inc.,CN=America Online Root Certification Authority 1
Serial number: 1
Valid from: Tue May 28 08:00:00 CEST 2002 until: Thu Nov 19 21:43:00 CET 2037
Certificate fingerprints:
	 MD5:  14:F1:08:AD:9D:FA:64:E2:89:E7:1C:CF:A8:AD:7D:5E
	 SHA1: 39:21:C1:15:C1:5D:0E:CA:5C:CB:5B:C4:F0:7D:21:D8:05:0B:56:6A
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 40
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: L=ValiCert Validation Network,O=ValiCert\, Inc.,OU=ValiCert Class 2 Policy Validation Authority,CN=http://www.valicert.com/,E=info@valicert.com
Issuer: L=ValiCert Validation Network,O=ValiCert\, Inc.,OU=ValiCert Class 2 Policy Validation Authority,CN=http://www.valicert.com/,E=info@valicert.com
Serial number: 1
Valid from: Sat Jun 26 02:19:54 CEST 1999 until: Wed Jun 26 02:19:54 CEST 2019
Certificate fingerprints:
	 MD5:  A9:23:75:9B:BA:49:36:6E:31:C2:DB:F2:E7:66:BA:87
	 SHA1: 31:7A:2A:D0:7F:2B:33:5E:F5:A1:C3:4E:4B:57:E8:B7:D8:F1:FC:A6
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 1

*******************************************
*******************************************

Alias name: 39
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=US,O=VeriSign\, Inc.,OU=VeriSign Trust Network,OU=Terms of use at https://www.verisign.com/rpa (c)06,CN=VeriSign Class 3 Extended Validation SSL SGC CA
Issuer: C=US,O=VeriSign\, Inc.,OU=VeriSign Trust Network,OU=(c) 2006 VeriSign\, Inc. - For authorized use only,CN=VeriSign Class 3 Public Primary Certification Authority - G5
Serial number: 112a006d37e5106fd6ca7cc3efbacc18
Valid from: Wed Nov 08 01:00:00 CET 2006 until: Tue Nov 08 00:59:59 CET 2016
Certificate fingerprints:
	 MD5:  15:37:78:6E:D5:89:C8:CF:11:DC:9D:61:70:75:25:E9
	 SHA1: 4A:8A:2A:0E:27:6F:F3:3B:5D:D8:8A:36:21:46:01:0F:2A:8B:6A:EE
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 38
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=BE,O=GlobalSign nv-sa,OU=Root CA,CN=GlobalSign Root CA
Issuer: C=BE,O=GlobalSign nv-sa,OU=Root CA,CN=GlobalSign Root CA
Serial number: 40000000001154b5ac394
Valid from: Tue Sep 01 14:00:00 CEST 1998 until: Fri Jan 28 13:00:00 CET 2028
Certificate fingerprints:
	 MD5:  3E:45:52:15:09:51:92:E1:B7:5D:37:9F:B1:87:29:8A
	 SHA1: B1:BC:96:8B:D4:F4:9D:62:2A:A8:9A:81:F2:15:01:52:A4:1D:82:9C
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 37
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=HU,ST=Hungary,L=Budapest,O=NetLock Halozatbiztonsagi Kft.,OU=Tanusitvanykiadok,CN=NetLock Kozjegyzoi (Class A) Tanusitvanykiado
Issuer: C=HU,ST=Hungary,L=Budapest,O=NetLock Halozatbiztonsagi Kft.,OU=Tanusitvanykiadok,CN=NetLock Kozjegyzoi (Class A) Tanusitvanykiado
Serial number: 103
Valid from: Thu Feb 25 00:14:47 CET 1999 until: Wed Feb 20 00:14:47 CET 2019
Certificate fingerprints:
	 MD5:  86:38:6D:5E:49:63:6C:85:5C:DB:6D:DC:94:B7:D0:F7
	 SHA1: AC:ED:5F:65:53:FD:25:CE:01:5F:1F:7A:48:3B:6A:74:9F:61:78:C6
	 Signature algorithm name: MD5WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 36
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=US,O=Entrust\, Inc.,OU=AND ADDITIONAL TERMS GOVERNING USE AND RELIANCE,OU=CPS CONTAINS IMPORTANT LIMITATIONS OF WARRANTIES AND LIABILITY,OU=www.entrust.net/CPS is incorporated by reference,OU=(c) 2008 Entrust\, Inc.,CN=Entrust Certification Authority - L1B
Issuer: O=Entrust.net,OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.),OU=(c) 1999 Entrust.net Limited,CN=Entrust.net Certification Authority (2048)
Serial number: 3863c5ae
Valid from: Mon Aug 25 20:14:26 CEST 2008 until: Sat Aug 25 20:44:26 CEST 2018
Certificate fingerprints:
	 MD5:  C2:DF:86:BD:E4:8B:FF:26:4D:AE:6A:26:1D:7A:70:D9
	 SHA1: 19:98:49:D9:A9:E9:F5:28:43:6C:72:65:30:2A:15:2C:C0:9B:CA:9E
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 35
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=FI,O=Sonera,CN=Sonera Class2 CA
Issuer: C=FI,O=Sonera,CN=Sonera Class2 CA
Serial number: 1d
Valid from: Fri Apr 06 09:29:40 CEST 2001 until: Tue Apr 06 09:29:40 CEST 2021
Certificate fingerprints:
	 MD5:  A3:EC:75:0F:2E:88:DF:FA:48:01:4E:0B:5C:48:6F:FB
	 SHA1: 37:F7:6D:E6:07:7C:90:C5:B1:3E:93:1A:B7:41:10:B4:F2:E4:9A:27
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 34
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=JP,O=SECOM Trust.net,OU=Security Communication RootCA1
Issuer: C=JP,O=SECOM Trust.net,OU=Security Communication RootCA1
Serial number: 0
Valid from: Tue Sep 30 06:20:49 CEST 2003 until: Sat Sep 30 06:20:49 CEST 2023
Certificate fingerprints:
	 MD5:  F1:BC:63:6A:54:E0:B5:27:F5:CD:E7:1A:E3:4D:6E:4A
	 SHA1: 36:B1:2B:49:F9:81:9E:D7:4C:9E:BC:38:0F:C6:56:8F:5D:AC:B2:F7
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 33
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=BM,O=QuoVadis Limited,CN=QuoVadis Root CA 3
Issuer: C=BM,O=QuoVadis Limited,CN=QuoVadis Root CA 3
Serial number: 5c6
Valid from: Fri Nov 24 20:11:23 CET 2006 until: Mon Nov 24 20:06:44 CET 2031
Certificate fingerprints:
	 MD5:  31:85:3C:62:94:97:63:B9:AA:FD:89:4E:AF:6F:E0:CF
	 SHA1: 1F:49:14:F7:D8:74:95:1D:DD:AE:02:C0:BE:FD:3A:2D:82:75:51:85
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 32
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert High Assurance EV Root CA
Issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert High Assurance EV Root CA
Serial number: 2ac5c266a0b409b8f0b79f2ae462577
Valid from: Fri Nov 10 01:00:00 CET 2006 until: Mon Nov 10 01:00:00 CET 2031
Certificate fingerprints:
	 MD5:  D4:74:DE:57:5C:39:B2:D3:9C:85:83:C5:C0:65:49:8A
	 SHA1: 5F:B7:EE:06:33:E2:59:DB:AD:0C:4C:9A:E6:D3:8F:1A:61:C7:DC:25
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************

Alias name: 31
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: L=ValiCert Validation Network,O=ValiCert\, Inc.,OU=ValiCert Class 3 Policy Validation Authority,CN=http://www.valicert.com/,E=info@valicert.com
Issuer: L=ValiCert Validation Network,O=ValiCert\, Inc.,OU=ValiCert Class 3 Policy Validation Authority,CN=http://www.valicert.com/,E=info@valicert.com
Serial number: 1
Valid from: Sat Jun 26 02:22:33 CEST 1999 until: Wed Jun 26 02:22:33 CEST 2019
Certificate fingerprints:
	 MD5:  A2:6F:53:B7:EE:40:DB:4A:68:E7:FA:18:D9:10:4B:72
	 SHA1: 69:BD:8C:F4:9C:D3:00:FB:59:2E:17:93:CA:55:6A:F3:EC:AA:35:FB
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 1

*******************************************
*******************************************

Alias name: 30
Creation date: Jun 7, 2010
Entry type: trustedCertEntry

Owner: C=BM,O=QuoVadis Limited,CN=QuoVadis Root CA 2
Issuer: C=BM,O=QuoVadis Limited,CN=QuoVadis Root CA 2
Serial number: 509
Valid from: Fri Nov 24 19:27:00 CET 2006 until: Mon Nov 24 19:23:33 CET 2031
Certificate fingerprints:
	 MD5:  5E:39:7B:DD:F8:BA:EC:82:E9:AC:62:BA:0C:54:00:2B
	 SHA1: CA:3A:FB:CF:12:40:36:4B:44:B2:16:20:88:80:48:39:19:93:7C:F7
	 Signature algorithm name: SHA1WithRSAEncryption
	 Version: 3

*******************************************
*******************************************
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.andreabaccega.com/blog/2010/09/23/android-root-certification-authorities-list/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Reading $_GET variable in CODEIGNITER</title>
		<link>http://www.andreabaccega.com/blog/2010/08/14/reading-get-variable-on-codeigniter/</link>
		<comments>http://www.andreabaccega.com/blog/2010/08/14/reading-get-variable-on-codeigniter/#comments</comments>
		<pubDate>Sat, 14 Aug 2010 14:01:56 +0000</pubDate>
		<dc:creator>veke87</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.andreabaccega.com/?p=454</guid>
		<description><![CDATA[There are multiple solutions out there but i did create my own. It&#8217;s simple as 1,2,3. Hope it helps.]]></description>
			<content:encoded><![CDATA[<p>There are multiple solutions out there but i did create my own.</p>
<p>It&#8217;s simple as 1,2,3. Hope it helps.</p>
<pre class="brush: php; title: ; notranslate">
		// CODEIGNITER HACK
		$tmp = explode('?',$_SERVER['REQUEST_URI']);
		$tmp = explode('&amp;', $tmp[1]);

		foreach($tmp as $keyval) {
			$tmpAppoggio = explode('=', $keyval);
			$_GET[urldecode($tmpAppoggio[0])]=urldecode($tmpAppoggio[1]);
		}
		// end of codeigniter hack
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.andreabaccega.com/blog/2010/08/14/reading-get-variable-on-codeigniter/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Write an SMS without sending it on Android 2.2 Froyo</title>
		<link>http://www.andreabaccega.com/blog/2010/08/12/write-an-sms-without-sending-it-on-android-2-2-froyo/</link>
		<comments>http://www.andreabaccega.com/blog/2010/08/12/write-an-sms-without-sending-it-on-android-2-2-froyo/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 20:37:42 +0000</pubDate>
		<dc:creator>veke87</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[froyo]]></category>
		<category><![CDATA[sms]]></category>
		<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://www.andreabaccega.com/?p=451</guid>
		<description><![CDATA[I just figured out how to write an sms without sending it really on android froyo 2.2 using the content provider. I&#8217;ll write only the snippet here. Hope it helps Obviously you should set the right permissions on the manifest &#8230; <p><a class="btn small" href="http://www.andreabaccega.com/blog/2010/08/12/write-an-sms-without-sending-it-on-android-2-2-froyo/">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
			<content:encoded><![CDATA[<p>I just figured out how to write an sms without sending it really on android froyo 2.2 using the content provider.</p>
<p>I&#8217;ll write only the snippet here. Hope it helps</p>
<pre class="brush: java; title: ; notranslate">
	/**
	 * writes an sms on the contentprovider
	 * @param ctx Context
	 * @param mobNo mobile number
	 * @param msg text of the message
	 */
	private final static void storeMessage(Context ctx,String mobNo, String msg) {
		ContentValues values = new ContentValues();
		values.put(&quot;address&quot;, mobNo);
		values.put(&quot;body&quot;, msg);
		ctx.getContentResolver().insert(Uri.parse(&quot;content://sms/sent&quot;), values);
	}
</pre>
<p>Obviously you should set the right permissions on the manifest ( Yes the following are all needed for this task ) :</p>
<pre class="brush: xml; title: ; notranslate">
&lt;manifest&gt;
	....
	....
	&lt;uses-permission android:name=&quot;android.permission.WRITE_SMS&quot;&gt;&lt;/uses-permission&gt;
	&lt;uses-permission android:name=&quot;android.permission.READ_SMS&quot;&gt;&lt;/uses-permission&gt;
&lt;/manifest&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.andreabaccega.com/blog/2010/08/12/write-an-sms-without-sending-it-on-android-2-2-froyo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

