我正在使用与此处的答案几乎相同的方法从 Windows CA 证书存储中导出证书: Get chain of certificates for a file with PowerShell?在这里Automate export x509 certificate w/chain from Server 2008 R2 to a p7b file WITHOUT external tools?除非我是从 CA 系统商店获取的。
这有效,openssl 和 certutil 之类的东西可以读取我的证书。但是,我需要 Java 来读取我的证书,Java 8 keystore 类和 keytool 命令行工具( keytool -list -v -keystore v.p12 -storetype pkcs12 -storepass pass
)都说我的证书有 0 个条目,而 openssl 和 certutil 显示有条目。
如何以 Java 可读格式导出证书,或轻松将其转换为 Java 可读格式,同时将其保留在 pkcs12 中?我真正想要导出的机器没有 openssl,所以请记住这一点。示例文件(密码为“pass”)位于:https://mega.nz/#!Cj5GGIBR!O5shbaPuHNKEJhRrivR0TY3hRd3ZRYQzvRQFJa_ri3s
最佳答案
将 PKCS12 数据导入 JKS keystore :
keytool -importkeystore -srckeystore v.p12 -srcstoretype PKCS12 -destkeystore v.jks
关于java - Java 无法读取从 Windows CA 存储导出的证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51786962/