如何判断来自给定URL的证书是自签名的(如浏览器所做的)
URL destinationURL = new URL(url);
HttpsURLConnection conn = (HttpsURLConnection) destinationURL.openConnection();
conn.connect();
Certificate[] certs = conn.getServerCertificates();
但我唯一发现的是判断有效性(日期d).它运行得很好,但仅此而已.
如何判断来自给定URL的证书是自签名的(如浏览器所做的)
URL destinationURL = new URL(url);
HttpsURLConnection conn = (HttpsURLConnection) destinationURL.openConnection();
conn.connect();
Certificate[] certs = conn.getServerCertificates();
但我唯一发现的是判断有效性(日期d).它运行得很好,但仅此而已.
这里有一篇相关的Red Hat篇文章.
100.
"... A certificate is self-signed if the subject and issuer match. A certificate is signed by a Certificate Authority (CA) if they are different. ..."个
您可以利用100类,它提供101和102个方法.