我有下一个代码:
// Load the JDK's cacerts keystore file
String filename = System.getProperty("java.home") + "/lib/security/cacerts".replace('/', File.separatorChar);
FileInputStream is = new FileInputStream(filename);
KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());
String password = "changeit";
keystore.load(is, password.toCharArray());
// This class retrieves the most-trusted CAs from the keystore
PKIXParameters params = new PKIXParameters(keystore);
// Get the set of trust anchors, which contain the most-trusted CA certificates
Iterator it = params.getTrustAnchors().iterator();
while( it.hasNext() ) {
TrustAnchor ta = (TrustAnchor)it.next();
// Get certificate
X509Certificate cert = ta.getTrustedCert();
System.out.println(cert);
}
有了这个我有信任根证书列表,但我想要客户端认证列表,你可以在Internet Explorer中找到的认证。
有人可以帮助我吗?
谢谢!
答案 0 :(得分:0)
在http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/jcp/jcp.html#security,您可以看到证书存储在${user.home}/.java/deployment/security
。
所有浏览器都在其特定位置管理证书。