It seems the version of BouncyCastle shipped with Android 4.0.3 (API version 15) fails when trying to open keystores produced using the most recent BouncyCastle library. When I created a keystore using bcprov-jdk15on-147.jar
, my sample Android app failed with the java.io.IOException: Wrong version of key store
error.
However, if the keystore was created with the bcprov-jdk16-146.jar
library, then it could be loaded by the application. My solution was to create the keystore with this older library.
Presumably this will also be the case for older API versions; try older versions of BouncyCastle when creating the keystore.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…