I have a problem with importing certificate to application.
I have created BKS keystore with keytool. I put it to res/raw folder.
I’m able to load it to Android.
InputStream inputStream = context.getResources().openRawResource(R.raw.enigma);
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
keyStore.load(inputStream, "android".toCharArray());
inputStream.close();
String algorithm = KeyManagerFactory.getDefaultAlgorithm();
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(algorithm);
keyManagerFactory.init(keyStore, "android".toCharArray());
When I try to call SSLServerSocket.accept() then, I receive an Exception: “SSLException: Could not find any key store entries to support the enabled cipher suites”.
What can be wrong? Is there tutorial for creating KeyStore on Android.
Thanks
There was my mistake. I created self-signed certificate with OpenSSL tool. But I forgot to pack this certificate with private key to p12 object.