"stream is not a PKCS12 key store" after saving with a new password on an Android device

I wrote an Android app that uses KeyStore to authenticate an SSL connection. But when I download the p12 file with the right key and save it with a new one, the next time I try to download it with a new key, I get this exception:

java.io.IOException: stream is not a PKCS12 key store
at com.android.org.bouncycastle.jce.provider.JDKPKCS12KeyStore.engineLoad (JDKPKCS12KeyStore.java:691)
in java.security.KeyStore.load (KeyStore.javaโˆ—89)

What's wrong?

Many thanks!

+7
source share
1 answer

The problem was (I'm ashamed to admit), mistakenly saving another KeyStore . After making sure that I am working on the same KeyStore , the problem is fixed, and now it works fine.

+8
source

All Articles