keystore - How to retrieve client cert from android cert store -
i have created client cert using self signed root ca, installed clientcert.p12 file in android device.
i need use cert in app, following code piece have tried.
keystore store = keystore.getinstance("pkcs12"); if (store != null) { store.load(null, new string("the keystore password").tochararray()); log.i("birajendu", "cert check" + "type: "+ store.gettype()+ " size: " +store.size()); enumeration<string> aliases = store.aliases(); if (!aliases.hasmoreelements()) { log.i("birajendu", "no cert found"); }
}
i getting store.size() zero.
but if use keystore store = keystore.getinstance("androidcastore");
, getting proper store size. here need find pkcs12 store.
you'll need use android keychain (https://developer.android.com/reference/android/security/keychain.html).
Comments
Post a Comment