keytool 命令的 import 和 -importcert 有什么区别

What is the difference between keytool command's import and -importcert

我被告知使用 keytool 命令将证书(.crt 格式)添加到密钥库文件。这里需要用到什么选项,import或者-importcert。分别在什么时候使用?

从该文档 keytool - Key and Certificate Management Tool,页面末尾的 更改 部分说:

Renamed commands:

-import, renamed to -importcert

所以他们基本上是一样的,尽管改名了,-import 应该以后仍然存在:

All previous commands (both renamed and obsolete) are still supported in this release and will continue to be supported in future releases.

请注意,这是来自 Java SE 7 文档,但来自 Java SE 8 (unix/windows) 的文档也说:

This command was named -import in earlier releases. This old name is still supported in this release. The new name, -importcert, is preferred going forward.