NoSuchAlgorithmException with KeyStore.getInstance in android application

android, java, ssl

Solution

Android does not support JKS keystore. However you can convert your JKS keystore to BouncyCastle BKS keystore and it will work.

@edit

You will need bcprov-jdk16-145.jar

keytool -importkeystore -srckeystore mytruststore.jks -destkeystore mytruststore.bks -srcstoretype JKS -deststoretype BKS -srcstorepass changeit -deststorepass changeit -provider org.bouncycastle.jce.provider.BouncyCastleProvider 

If your bcprov jar is in another directory add -providerpath path.

code taken from: http://www.knowledgebit.appspot.com/zahangirbd/TopicView.action;jsessionid=E2BZt_6bp4uFFbMyq42gWg?id=56001

Problem

I write program in android for communication with server, I use SSL protocol, when I write this code ``` KeyStore ks = KeyStore.getInstance( "JKS" ); ``` I get this error java.security.NoSuchAlgorithmException: KeyStore JKS implementation not found How can I resolve my problem? My Algorithm is JKS. Best Regards

Original source

Related problems