title: Using Android's KeyChain API for exchanging public keys
body: <p>I am trying to write an application that enables users to exchange their public (e.g. RSA) keys via Bluetooth/NFC. To store and later retrieve the keys, I would like to use <a href="http://developer.android.com/reference/android/security/KeyChain.html" rel="nofollow">Android's KeyChain API.</a> </p>
  
  <p>I have read the online API documentation and some tutorials/examples so far. They all involve importing a keychain from a PKCS12 file which contains a private key and the corresponding public key and certificate. Once this file is imported, an alias-String is returned for subsequent reference. So far, so good.</p>
  
  <p>However, what I want to do is receive someone's public key, store it, get back an alias, store that alias somewhere (e.g. contacts data) and use it to retrieve back the public key when the user wants to encrypt a message to that person. Is that possible? I have very little experience with Public-key cryptography and have the feeling that I have misunderstood the whole purpose of the KeyChain API.</p>
  
  <p>Any help would be much apprechiated! Thanks.</p>