我正在使用命令创建pkcs12
格式的密钥库:
> openssl pkcs12 -export -in <cert> -inkey <key> -out mycert.p12 -name <name> -caname <caname>
创建后,我'检查创建的密钥库:
> keytool -list -keystore mycert.p12
Enter keystore password:
Keystore type: JKS
Keystore provider: SUN
...
它显示了JKS
的类型。
当我明确指定密钥库的类型时,输出似乎是正确的:
> keytool -list -keystore mycert.p12 -storetype pkcs12
Enter keystore password:
Keystore type: PKCS12
Keystore provider: SunJSSE
为什么keytool
在未指定storetype
时错误地显示密钥库的类型?这种行为对我来说似乎不正确,如果该工具无法弄明白,该命令应该失败或者不显示密钥库类型。
您可能使用的是旧的keytool版本,而不是Java 8u192附带的版本。
有一个bug qazxsw poi记者有同样的问题。
我安装的jdk 1.8.0_161遇到了同样的问题 - 使用(当前)版本8u201后,keystore-type显示正确。