是否仍然需要 keytool 从 Let's Encrypt pem 文件中的 OpenSSL 创建的 PKCS12 密钥库创建 PKCS12 密钥库?
Is keytool still necessary to create a PKCS12 keystore from a PKCS12 keystore created by OpenSSL from Let's Encrypt pem files?
我使用Java11(AdoptOpenJDK),keytool uses PKCS12 by default since Java 9, I need a PKCS12 keystore for Jetty 11. Let's Encrypt gives me two pem files. Therefore, I convert those 2 pem files into a PKCS12 keystore with OpenSSL and I use keytool as advised in a tutorial:
openssl pkcs12 -export -inkey /etc/letsencrypt/live/$domainName/privkey.pem -in /etc/letsencrypt/live/$domainName/fullchain.pem -out /etc/letsencrypt/live/$domainName/jetty.pkcs12 -passout "pass:$srcKeystorePassword"
keytool -importkeystore -noprompt -srckeystore /etc/letsencrypt/live/$domainName/jetty.pkcs12 -srcstoretype PKCS12 -srcstorepass $srcKeystorePassword -destkeystore /etc/letsencrypt/live/$domainName/keystore -deststorepass $destKeystorePassword
第二行不是没用吗(除了换个密码)?我现在不能自己检查它,因为我昨天超过了 Let's Encrypt 的每周限制并且我没有保留创建的 pem 文件。我写了 a script to ease self-hosting,我想从中删除任何不必要的步骤。
我可以简单地复制由 OpenSSL 创建的 PKCS12 密钥库吗?有什么我遗漏的微妙之处吗?
keytool
对于仅支持 JKS 的应用程序服务器或软件是必需的,但在我的情况下不再需要,因为 Jetty 11 支持 PKCS12。
请注意 keytool
使用 PKCS12 by default since Java 9 (i.e when you don't force the store type) but it was already possible to use this store type as an option with -storetype pkcs12
since Java 6(甚至可能在早期版本中)。
我使用Java11(AdoptOpenJDK),keytool uses PKCS12 by default since Java 9, I need a PKCS12 keystore for Jetty 11. Let's Encrypt gives me two pem files. Therefore, I convert those 2 pem files into a PKCS12 keystore with OpenSSL and I use keytool as advised in a tutorial:
openssl pkcs12 -export -inkey /etc/letsencrypt/live/$domainName/privkey.pem -in /etc/letsencrypt/live/$domainName/fullchain.pem -out /etc/letsencrypt/live/$domainName/jetty.pkcs12 -passout "pass:$srcKeystorePassword"
keytool -importkeystore -noprompt -srckeystore /etc/letsencrypt/live/$domainName/jetty.pkcs12 -srcstoretype PKCS12 -srcstorepass $srcKeystorePassword -destkeystore /etc/letsencrypt/live/$domainName/keystore -deststorepass $destKeystorePassword
第二行不是没用吗(除了换个密码)?我现在不能自己检查它,因为我昨天超过了 Let's Encrypt 的每周限制并且我没有保留创建的 pem 文件。我写了 a script to ease self-hosting,我想从中删除任何不必要的步骤。
我可以简单地复制由 OpenSSL 创建的 PKCS12 密钥库吗?有什么我遗漏的微妙之处吗?
keytool
对于仅支持 JKS 的应用程序服务器或软件是必需的,但在我的情况下不再需要,因为 Jetty 11 支持 PKCS12。
请注意 keytool
使用 PKCS12 by default since Java 9 (i.e when you don't force the store type) but it was already possible to use this store type as an option with -storetype pkcs12
since Java 6(甚至可能在早期版本中)。