简体   繁体   English

将公共证书、私钥和证书链 .pem 文件转换为 jks 密钥库

[英]Convert public cert, private key, and certificate chain .pem files to jks keystore

I have 3 separate .pem files:我有 3 个单独的 .pem 文件:

publicCert.pem
privateKey.pem
CertificateChain.pem

I want to put these into a new java keystore.我想将这些放入一个新的java 密钥库中。

I have seen this question asked and answered before, but with only 1 or 2 .pem files, not 3, and not specifically for a new jks.我之前看过这个问题的提问和回答,但只有 1 或 2 个 .pem 文件,而不是 3 个,也不是专门针对jks 的。

Additionally the other web servers run on IIS, and are using SSL with a wildcard domain.此外,其他 Web 服务器在 IIS 上运行,并使用带有通配符域的 SSL。 example: *domain.com例如:*domain.com

Can I create a jks for a wildcard domain?我可以为通配符域创建 jks 吗? Looks like that may be tricky?看起来这可能很棘手?

Commands appreciated!命令赞赏!

Build a PKCS12 file, then use Java's Keytool to convert to a Java keystore. 构建一个PKCS12文件,然后使用Java的Keytool转换为Java密钥库。

openssl pkcs12 -export -chain -inkey privateKey.pem -CAfile CertificateChain.pem -in publicCert.pem -out myp12file.p12

keytool -importkeystore -destkeystore mykeystore.jks -srckeystore myp12file.p12 -srcstoretype pkcs12 -destalias mykey -srcalias 1

It will ask you for passwords, too. 它还会要求您输入密码。

I have just one file: name.jks.我只有一个文件:name.jks。 I would like to have cafile.pem, certfile.pem and keyfile.pem.我想要 cafile.pem、certfile.pem 和 keyfile.pem。 How can I get it?我怎么才能得到它?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法使用密钥,证书和CA为Tomcat创建密钥库证书链长度:1 - Can't create keystore for Tomcat with key, cert and CAs Certificate chain length: 1 为tomcat / JKS Keystore转换PKCS12格式的证书 - Convert certificate in PKCS12 format for tomcat / JKS Keystore 在AWS的docker中的tomcat上具有CA,中级和网站证书的Java jks密钥库给出了“无法识别对等证书颁发者” - Java jks keystore with CA, intermediate and website cert on tomcat in docker on AWS gives “Peer's Certificate issuer is not recognised” 如何从自签名证书的密钥库中导出私钥 - How to export private key from a keystore of self-signed certificate 是否可以在新的密钥库中安装现有的私钥和 ssl 证书? - Is it possible to install existing private key and ssl certificate in a new keystore? 如何从证书颁发机构提供的PEM文件正确创建Java密钥库文件? - How to correctly create a java keystore file from PEM files provided by a Certificate Authority? 将自签名证书链添加到密钥库 - Add Self Signed Certificate Chain to keystore 将证书导入Java密钥库,JVM会忽略新的证书 - Imported certificate to Java keystore, JVM ignores the new cert 使用.key,.ca和.cert文件为tomcat创建密钥库 - create keystore for tomcat using .key ,.ca and .cert file 在 Tomcat/Spring Boot 上配置 SSL(“Could not find key store classpath:keystore.jks”错误) - Configuring SSL on Tomcat/Spring Boot ("Could not find key store classpath:keystore.jks" error)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM