If you are using Java 8 or newer you should definitely choose PKCS12
, the default since Java 9 (JEP 229).
The advantages compared to JKS
and JCEKS
are:
PKCS12
is a standard format, it can be read by other programs and libraries1JKS
and JCEKS
are pretty insecure. This can be seen by the number of tools for brute forcing passwords of these keystore types, especially popular among Android developers.2, 31 There is JDK-8202837, which has been fixed in Java 11
2 The iteration count for PBE used by all keystore types (including PKCS12) used to be rather weak (CVE-2017-10356), however this has been fixed in 9.0.1, 8u151, 7u161, and 6u171
3 For further reading: