Android KeyStoreException Unknown Error

I found my answer on the Android Issue Tracker; from what I understand the unrestricted PublicKey, created to work around another known issue, becomes incompatible with the current Cipher. The work-around for this is to specify an OAEPParameterSpec when the Cipher is initialized: OAEPParameterSpec spec = new OAEPParameterSpec( “SHA-256”, “MGF1”, MGF1ParameterSpec.SHA1, PSource.PSpecified.DEFAULT); mCipher.init(opmode, unrestricted, spec);

How to build a SSLSocketFactory from PEM certificate and key without converting to keystore?

It turned out that a KeyStore instance still has to be built, but it can be done in memory (starting with PEM files as input), without using an intermediate keystore file build with keytool. To build that in-memory KeyStore, code like the following may be used: private static final String TEMPORARY_KEY_PASSWORD = “changeit”; private KeyStore … Read more

How to generate keystore and truststore

I followed This link. 1.Generate keystore(At server): keytool -genkey -alias bmc -keyalg RSA -keystore KeyStore.jks -keysize 2048 2.Generate new ca-cert and ca-key: openssl req -new -x509 -keyout ca-key -out ca-cert 3.Extracting cert/creating cert sign req(csr): keytool -keystore KeyStore.jks -alias bmc -certreq -file cert-file 4.Sign the “cert-file” and cert-signed wil be the new cert: openssl x509 … Read more