在Android应用程序中加载x509certificate(.cer)

时间:2016-08-20 05:57:42

标签: android x509certificate2

我从网络服务获得x509certificate,我想在屏幕上为用户加载它。

我写了这段代码。我在t变量中有证书。但我不知道如何在屏幕上显示它。

InputStream is = new ByteArrayInputStream(Base64.decode(cert.toString(), Base64.DEFAULT));
CertificateFactory cf = CertificateFactory.getInstance("X.509","BC");
java.security.cert.Certificate c = cf.generateCertificate(is);
X509Certificate t = (X509Certificate) c;

0 个答案:

没有答案