Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keytool list command shows incorrect keystore format

I'm creating a keystore in the pkcs12 format using command:

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

Once created I' checking the created keystore:

> keytool -list -keystore mycert.p12 
Enter keystore password:  

Keystore type: JKS
Keystore provider: SUN
...

It's shows the type JKS.

When I specify the type of the keystore explicitly the output seems correct:

> keytool -list -keystore mycert.p12 -storetype pkcs12
Enter keystore password:  

Keystore type: PKCS12
Keystore provider: SunJSSE

Why does keytool incorrectly show the type of the keystore when the storetype is not specified? This behaviour seems incorrect for me, the command should either fail or do not show the keystore type if the tool can't figure it out.

like image 373
erkfel Avatar asked Oct 16 '22 19:10

erkfel


1 Answers

You 've may used a older keytool version than shipped with Java 8u192.

There was a bug JDK-8193171 reportet with the same issue.

I had the same problem with my installed jdk 1.8.0_161 - after using (the current) version 8u201 the keystore-type was displayed correctly.

like image 96
fty4 Avatar answered Oct 21 '22 08:10

fty4