I use
KeyStore store = KeyStore.getInstance("JCEKS");
But is make KeyStoreException
java.security.KeyStoreException: KeyStore JCEKS implementation not found
Reason is default security provider is bouncycastle in Android. Therefore I use
KeyStore store = KeyStore.getInstance("JCEKS", "SunJCE");
But is make NoSearchProviderException
java.security.NoSearchProviderException: SunJCE
Android does not include the SunJCE security provider and therefore JCEKS is not a supported Keystore type (neither is the older JKS format).
To create a KeyStore you can either choose the BouncyCastle Keystore
or, from Android 4.3, the new
AndroidKeyStore
based on OpenSSL decdicated to store app-private keys (more details here)And if you have a JCEKS Keystore you will have to convert it to BKS format with keytool: