错版密钥存储在Android的电话 [英] Wrong version of keystore on android call

查看:170
本文介绍了错版密钥存储在Android的电话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想打一个HTTPS请求。

I want to make a https request.

我用BouncyCastle的产生这样的密钥库:

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.

但是,当我做的:

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

我试图用几个版本bouncycast的,但结果是一样的。我也试图定义密钥长度1024,但没有任何变化。

I tried to use several version of bouncycast, but the result is the same. I also tried to define keysize 1024, but nothing change.

任何想法?

推荐答案

看看它的安卓信任的SSL证书

  -storetype BKS
  -provider org.bouncycastle.jce.provider.BouncyCastleProvider
  -providerpath /path/to/bouncycastle.jar

和创建密钥库时使用这个版本:版本1.46 这里找到

愿它可以帮助...

这篇关于错版密钥存储在Android的电话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆