title: Store & access x509 certificate in iPhone's keychain
body: <p>Can 3rd party application access iPhone's keychain in order to add X509 certificate to it? If yes, how can it be done?<br>
  If not, can it access keychain just to read certificates from it?     </p>
  
  <p>Basically, what I need is:<br>
  1) my application needs to access https site which uses certificate not signed by any trusted CA. when trying to connect via https, I get an exception.<br>
  2) it would be great If I could programmatically add the root's certificate to the keychain; it would be sufficient if the user could access the site via Safari, accept its certificate, and then access the site using my application.</p>
  
  <p>So far, I've been using the following interface to surpass https:</p>
  
  <pre><code>@interface NSURLRequest (DummyInterface)
  + (BOOL)allowsAnyHTTPSCertificateForHost:(NSString*)host;
  + (void)setAllowsAnyHTTPSCertificate:(BOOL)allow forHost:(NSString*)host;
  @end
  </code></pre>
  
  <p>but this is not exactly what I want.</p>
  
  <p>Any suggestions?</p>