简体   繁体   English

如果我没有私钥,如何将 pki 转换为 jks?

[英]how to convert a pki to jks if I don't have the private key?

The company signs it own certificates so this is giving problems to validate so I have added the custom ca authority to a pod running jenkins so now I can curl successfully against a service, the thing is that I'm trying to use a jenkins' plugin which continue to give ssl error so I think the problem is that I need to add the certs in jks format but all the info I found to convert a pem to jks is with the private key which I don't have.公司签署了自己的证书,所以这给验证带来了问题,所以我将自定义 ca 权限添加到运行 jenkins 的 pod 中,所以现在我可以针对服务成功 curl,问题是我正在尝试使用 jenkins 的插件继续给出 ssl 错误,所以我认为问题是我需要添加 jks 格式的证书,但我发现将 pem 转换为 jks 的所有信息都带有我没有的私钥。

The plugin which I need to make work is micro focus fortify plugin.我需要使用的插件是 micro focus fortify plugin。

How do I convert a public ca authority to jks if I don't have the private key?如果我没有私钥,如何将公共 ca 权限转换为 jks?

I'm guessing you're just trying to add your internal CA cert to the cacerts file that you Jenkins server is using.我猜您只是想将内部 CA 证书添加到 Jenkins 服务器正在使用的 cacerts 文件中。 The cacerts file is a keystore file that contains all of the public certs for trusted CAs and it will be located with the java installation that your Jenkins server is using. cacerts 文件是一个密钥库文件,其中包含受信任的 CA 的所有公共证书,它将位于您的 Jenkins 服务器正在使用的 java 安装中。

Please note that if you're trying to trust other certs that were signed by your CA, then you only need your CA's public certificate.请注意,如果您尝试信任由您的 CA 签署的其他证书,那么您只需要您的 CA 的公共证书。 You do not require the CA's private cert.您不需要 CA 的私有证书。 If you have an admin who gives out the private cert/key to anyone, you should probably slap that person because that is a major security risk.如果您有一个管理员向任何人提供私人证书/密钥,您可能应该打他一巴掌,因为这是一个重大的安全风险。

When Jenkins starts up, it will use the public CA certs from that cacerts file which will also be used by any Jenkins plugins that you use.当 Jenkins 启动时,它将使用该 cacerts 文件中的公共 CA 证书,您使用的任何 Jenkins 插件也将使用该证书。

To import a new CA cert, you just need the cert to be in base64 format.要导入新的 CA 证书,您只需要证书为 base64 格式。 You can use the following command to import:您可以使用以下命令导入:

keytool -importcert -file yourCAcert.pem -keystore cacerts -alias "YourCertAlias"

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM