I am writing an app which lists all the certificates installed on
the device. But I found that there are two places where certificates
are stored:

1. **System/etc/security/cacerts.bks**: This file contains list of all
pre-installed certificate. I am able to read this file using
Keystore class defined in frameworks/
base/keystore/java/android/security.
2. **data/misc/keystore**: Another way to install certificates (e.g. through
certinstaller app) installs third party certificate and makes
its entry in this directory.

But I am not getting how to read certificate info like SerialNumber,
IssuerDN etc. from this file.