I want to make a https request.
I use bouncycastle to generate the keystore like this :
keytool -importcert -trustcacerts -alias ludevCA -file lu_dev_cert.crt -keypass mypass -keystore keystore.bks -storepass mypass -storetype BKS -providerclass org.bouncycastle.jce.provider.BouncyCastleProvider -providerpath bcprov-jdk15on-146.jar
And the keylist command return a correct value.
But when i do :
KeyStore ks = KeyStore.getInstance("BKS"); InputStream in = getResources().openRawResource(R.raw.keystore); ks.load(in, "mypass".toCharArray());
i have a error :
wrong version of keystore
I tried to use several version of bouncycast, but the result is the same. I also tried to define keysize 1024, but nothing change.
Any ideas ?
The Android Keystore system lets you store cryptographic keys in a container to make it more difficult to extract from the device. Once keys are in the keystore, they can be used for cryptographic operations with the key material remaining non-exportable.
A keystore can be a repository where private keys, certificates and symmetric keys can be stored. This is typically a file, but the storage can also be handled in different ways (e.g. cryptographic token or using the OS's own mechanism.) KeyStore is also a class which is part of the standard API.
Have a Look on it Android: Trusting SSL certificates
-storetype BKS -provider org.bouncycastle.jce.provider.BouncyCastleProvider -providerpath /path/to/bouncycastle.jar
And use this version when creating your keystore: Version 1.46 found here
May it Helps...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With