public static synchronized void addCertificate(SslCertificate certificate) throws GeneralSecurityException, IOException {
KeyStore localTrustStore = loadTrustStore();
X509Certificate x509Certificate = getX509CertFromSslCertHack(certificate);
String alias = hashName(x509Certificate.getSubjectX500Principal());
localTrustStore.setCertificateEntry(alias, x509Certificate);
saveTrustStore(localTrustStore);
// reset fields so the keystore gets read again
mTrustManager = null;
mSslContext = null;
// notify listeners
synchronized (mListeners) {
for (CertChangedListener l : mListeners) {
l.certAdded();
}
}
}
ConnectionUtil.java 文件源码
java
阅读 38
收藏 0
点赞 0
评论 0
项目:habpanelviewer
作者:
评论列表
文章目录