인디노트
JRE cacerts 에 들어있는 인증서 리스트 본문
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance("PKIX");
trustManagerFactory.init((KeyStore) null);
TrustManager[] trustManagers = trustManagerFactory.getTrustManagers();
X509TrustManager trustManager = (X509TrustManager) trustManagers[0];
X509Certificate[] acceptedIssuers = trustManager.getAcceptedIssuers();
System.out.println("X509TrustManager count : " + trustManagers.length);
System.out.println("X509Certificate count : " + acceptedIssuers.length);
for(X509Certificate x509cert : acceptedIssuers)
{
String IssuerDNName = x509cert.getIssuerDN().getName();
BigInteger serialNumber = x509cert.getSerialNumber();
if(IssuerDNName.toLowerCase().indexOf("entrust")>=0)
{
System.out.println("x509cert IssuerDNName : " + IssuerDNName);
System.out.println("x509cert serialNumber : " + serialNumber);
}
}
'소스 팁 > Java, Android, Kotlin' 카테고리의 다른 글
Could not generate DH keypair (0) | 2018.06.01 |
---|---|
HTTPS (SSL 사이트) 읽어오기 - readFromSSLUrl (0) | 2018.06.01 |
Java code 에서 Java 버전 확인 (0) | 2018.06.01 |
How To Avoid javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated Problem Using Apache HttpClient (0) | 2018.05.31 |
How to read p12 file from system in Java? (0) | 2018.05.16 |