RFR: 8286069: keytool prints out wrong key algorithm for -importpass command

Hai-May Chao hchao at openjdk.java.net
Tue May 3 21:28:32 UTC 2022


On Tue, 3 May 2022 17:51:43 GMT, Weijun Wang <weijun at openjdk.org> wrote:

> Since `keytool -importpass` always uses `KeyFactory.getInstance("PBE")` to generate the secret key, and "PBE" is an alias of "PBEwithMD5andDES" inside the SunJCE security provider, its `getAlgorithm` is always `PBEwithMD5andDES`.
> 
> This code change modifies it to "PBE".
> 
> Note that I haven't chosen the `-keyalg` option value here because it is actually the algorithm used to protect the PBE secret key entry. It's a cipher algorithm instead of a key algorithm.

LGTM.

-------------

Marked as reviewed by hchao (Committer).

PR: https://git.openjdk.java.net/jdk/pull/8520



More information about the security-dev mailing list