我可以通过java在我的系统上安装证书吗

2022-01-25 00:00:00 security digital-certificate java

我可以通过 java 在我的系统上安装证书吗

Can i get installed certificates on my system through java

类似这样的东西.证书[] 证书 = someClass.getsystemCertificates();

something like this Eg. Certificate[] certificate = someClass.getsystemCertificates();

有没有可用的api????

Is there is some api available for this????

推荐答案

您可以使用 keytool 命令获取您的 cacerts 文件中的证书列表,该文件是 Java 批准的证书的集合附带.此密钥库的默认密码是changeit".

You can use the keytool command to get the list of certificates in your cacerts file, which is the collection of approved certificates that Java comes with. The default password for this keystore is "changeit".

keytool -list -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit

相关文章