能,我用的就是,但是这个错误我没遇到过
解决方案 »
- 安卓下一个自动连接WEP类型WIFI的APK,无法自动连接
- 关于ViewFlipper和Gallery的问题
- android两个应用跳转出现错误
- 现在搭建Android开发平台需要哪些组件?(望有经验的前辈指教)
- Could not create tab content because could not find view with id
- 视频流和音频流合并要什么技术
- 怎样使listview里面的button失去焦点,属性怎么设置
- Android系统上如何分析自己App的耗电程度
- Android模拟器可以有IP地址吗?
- eclipse adt avd不能创建
- android 控件跟随手指移动 在帧布局中点击控件 控件消失
- 关于Android拍照的一个问题
AssetManager am = getApplicationContext().getAssets();
InputStream ins = am.open("srca.cer");
try {
// 读取证书
CertificateFactory cerFactory = CertificateFactory
.getInstance("X.509"); // 问1
Certificate cer = cerFactory.generateCertificate(ins);
// 创建一个证书库,并将证书导入证书库
KeyStore keyStore = KeyStore.getInstance("PKCS12", "BC"); // 问2
keyStore.load(null, null);
keyStore.setCertificateEntry("trust", cer);
return keyStore;
} catch (Exception e) {
return null;
} finally {
ins.close();
}
}这是我自己写的一段 证书获取的代码