openssl - Keytool list 命令显示不正确的 keystore 格式

标签 openssl keytool pkcs#11 pkcs#12 jks

我正在 pkcs12 中创建一个 keystore 使用命令格式化:

> openssl pkcs12 -export -in <cert> -inkey <key> -out mycert.p12 -name <name> -caname <caname>

创建后,我会检查创建的 keystore :
> keytool -list -keystore mycert.p12 
Enter keystore password:  

Keystore type: JKS
Keystore provider: SUN
...

它显示类型 JKS .

当我明确指定 keystore 的类型时,输出似乎正确:
> keytool -list -keystore mycert.p12 -storetype pkcs12
Enter keystore password:  

Keystore type: PKCS12
Keystore provider: SunJSSE

为什么keytool storetype 时错误地显示 keystore 的类型没有指定?这种行为对我来说似乎不正确,如果工具无法弄清楚,该命令要么失败,要么不显示 keystore 类型。

最佳答案

您可能使用了比 Java 8u192 附带的更旧的 keytool 版本。

有一个错误 JDK-8193171报告同样的问题。

我安装的 jdk 1.8.0_161 遇到了同样的问题 - 使用(当前)版本 8u201 后, keystore 类型显示正确。

关于openssl - Keytool list 命令显示不正确的 keystore 格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50160296/

相关文章:

java - 尝试刷新 'expired' keystore

ssl - PKIX 路径不与 Windows 环境中的任何信任 anchor 错误链接

go - Pkcs11 ECDSA 签名返回 CKR_DATA_INVALID

Java IAIK Pkcs11 包装器生成的 key 未保留

java - 无法加载 RSA 私钥来签署字符串

c - 在终端上解密 openssl 库生成的密码,反之亦然

c++ - 公共(public)私钥生成(openssl,evp,EC)中的编译器错误

openssl - 创建 S/MIME 证书

java - 将公共(public)证书导入 keystore 时出错

java - PKCS11机制差异+JAVA