能,我用的就是,但是这个错误我没遇到过
解决方案 »
- android在锁屏界面之上添加一个View
- LED灯的控制。。。
- GoogleMap/GPS] Location获取经纬度问题?
- java.lang.UnsatisfiedLinkError: nativeConstructor,大侠help
- 有谁知道android官方开发论坛在哪?
- ListView item滚动至顶部时不再滚动,其它item滚动消失
- listview布局
- android 的二个问题(SDK源码,JNI)
- RadioGroup和RadioButton设置问题
- android studioyn模拟器只可以选择一个,别的怎么下载?
- 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();
}
}这是我自己写的一段 证书获取的代码