I'm working on an Android
multi module (multiple apps) project and encountered a use case where I have to save some secret information that could be accessed by all these apps. My idea is to encrypt the secret information using a private key that is saved inside the KeyStore
, and save this information in a file that I'm planning to store in the device (not external storage). My question is, would I be able to access this private key inside the KeyStore
from another application and then use it to decrypt the secret information that is saved in the device?
I was looking at Android's KeyStore
documentation, and if I understood it correctly, I can use the KeyStore
APIs to save the cryptographic keys and use them with in the same application. But also the KeyChain
documentation says I can use these cryptographic keys across multiple apps with in the system. I'm quite confused about how I can combine these two APIs and make it work for my use case. Any help is appreciated. Thank you.