title: How to install trusted CA certificate on Android device?
body: <p>I have created my own CA certificate and now I want to install it on my Android Froyo device (HTC Desire Z), so that the device trusts my certificate. </p>
  
  <p>Android stores CA certificates in its Java keystore in <code>/system/etc/security/cacerts.bks</code>. I copied the file to my computer, added my certificate using <a href="http://portecle.sourceforge.net/" rel="noreferrer">portecle 1.5</a> and pushed it back to the device. </p>
  
  <p>Now, Android does not seem to reload the file automatically. I have read in several blog posts that I need to restart the device. Doing so results in the file being overwritten with the original one again.</p>
  
  <p>My next try was to install the certificate from SD card by copying it and using the according option from the settings menu. The device tells me that the certificate has been installed, but apparently it does not trust the certificate. Moreover, when I try to copy the keystore to my computer, I still find the original stock <code>cacerts.bks</code>.</p>
  
  <p>So, what is the right way to install my own root CA certificate on an Android 2.2 device as a trusted certificate? Is there a way to do it programmatically?</p>