What's the location of the private certificate store on Android version below 4.0?

android

Solution

The key and certificate are encrypted and stored in `/data/misc/keystore`. However, since they have been stored by the system, you don't have the permission to access or decrypt them. Additionally, there is no public API for this.

Problem

I'm developing an Android app which reads a private certificate and key from the Android key store. The certificate was imported on Android from a `.p12` file on the SD card using Settings > Security > Install from storage (Credential storage). On version 4.0 and higher I can get certificate and key from Android KeyChain. Can I programmatically get this certificate on Android version below 4.0? I can see certificate and can choose it from WI-FI settings and that's all. I tried "BKS" and "PKCS12" stores, but get an empty resultset. I can access CA certificate store and get CA certificate data, but that is not what I need.

Original source