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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -