我从网络服务获得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;