title: How to securely share data between two or more applications in android?
body: <p>I am making an application framework for the enterprise environment which involves <strong><em>data sharing between two or more applications from the device memory</em></strong>. This data needs to be stored on the device and <strong><em>accessible to only a few applications (which can be identified by the certificates used to install them)</em></strong>. Also, it needs to be stored in a <strong>secure</strong> way so as to be not accessible to other third party applications . Which is the best way to implement this functionality ? </p>
  
  <p>I have read up about <a href="http://developer.android.com/training/articles/security-tips.html" rel="noreferrer"><strong>ContentProviders</strong> and <strong>ContentResolvers</strong></a> which to my understanding only facilitate this process . The actual storage of data is what is more important .I have also looked into the <a href="http://developer.android.com/reference/android/security/KeyChain.html" rel="noreferrer"><strong>Keychain API</strong></a> of Android which seems to be the closest to what I need to achieve. </p>
  
  <p>Is there a way to integrate <em>ContentProviders</em> and <em>ContentResolvers</em> with Keychain APIs ? Is this the correct way to do so ? If not , what is the <strong><em>best way to achieve the same</em></strong>?  Also, I haven't been able to find good <strong>code samples</strong> to completely understand the functioning of the <em>Keychain API</em>. <strong>Please Help!</strong> </p>
  
  <p>Edit :<br>
  I've also looked at the <a href="http://developer.android.com/training/articles/keystore.html#WhichShouldIUse" rel="noreferrer">Keystore API</a>. This internally uses the Keychain API and for sharing data between applications, Keychain should be used. Though I haven't been able to find code samples for the same or a detailed documentation or API guide on how to use the Keychain API. I am looking for an android equivalent of the <a href="https://developer.apple.com/library/mac/documentation/Security/Conceptual/keychainServConcepts/01introduction/introduction.html#//apple_ref/doc/uid/TP30000897-CH203-TP1" rel="noreferrer">iOS Keychain</a>. </p>
  
  <p>Something known as <a href="https://source.android.com/devices/tech/admin/managed-profiles.html" rel="noreferrer">managed profiles</a> has also been introduced in Android 5 . Is this the correct way to acheive what I am trying to do ? </p>