Tuesday, October 13, 2009

How to get the list of installed Android root certificates ?

Today, needed to get the list of trusted root certificates on Android phone to verify which ones are available out of the box.

Here are the easy steps how to do this :

1. get the certificates file
adb pull /system/etc/security/cacerts.bks cacerts.bks

2. download http://bouncycastle.org/download/bcprov-jdk16-141.jar and place it on $JAVA_HOME/jre/lib/ext/

3. run the keytool utility
keytool -storetype BKS -provider org.bouncycastle.jce.provider.BouncyCastleProvider -storepass -keystore cacerts.bks -list -v

Enjoy !

1 comment:

Sven said...

You're missing an empty string there :) For me the correct command is:

keytool -list -keystore ./cacerts.bks -storetype BKS -provider org.bouncycastle.jce.provider.BouncyCastleProvider -v -storepass ""

Cheers
Sven