Keytool list命令显示错误的密钥库格式

问题描述 投票:3回答:1

我正在使用命令创建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时错误地显示密钥库的类型?这种行为对我来说似乎不正确,如果该工具无法弄明白,该命令应该失败或者不显示密钥库类型。

openssl keytool pkcs#11 pkcs#12 jks
1个回答
1
投票

您可能使用的是旧的keytool版本,而不是Java 8u192附带的版本。

有一个bug qazxsw poi记者有同样的问题。

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

© www.soinside.com 2019 - 2024. All rights reserved.