本文介绍了未找到证书链的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在签署jar文件。由VeriSign提供的证书。
它提供两个证书: aplha-primary.cer
和 aplha-secoandary.cer
我使用以下命令生成密钥库文件:
keytool -importcert -v -alias -primary -keystore keystore / keystore.jks -file aplha-primary.cer
和
keytool -importcert -v -alias -secoandary -keystore keystore / keystore.jks -file aplha-secoandary.cer
它被导出到密钥库文件。 p>
当我尝试签署jar文件时,它会产生例外的异常
[signjar ] jarsigner:找不到证书链:必须
引用包含私钥和对应的
公钥证书链的有效KeyStore密钥条目。
jarsigner -keystore keystore.jks -storepass **** -keypass ****** Uploader.jar alpha-primary
jarsigner:找不到证书链: α-主要。 alpha-primary必须引用包含私钥和对应的公钥证书链的有效KeyStore密钥条目。
解决方案
我认为你缺少私钥。
对于jar的签名,使用不对称加密。
证书只包含公钥。
I am signing the jar file. The certificate provided by VeriSign.
It provide 2 certificates: aplha-primary.cer
and aplha-secoandary.cer
I generate the keystore file using the following commands:
keytool -importcert -v -alias -primary -keystore keystore/keystore.jks -file aplha-primary.cer
and
keytool -importcert -v -alias -secoandary -keystore keystore/keystore.jks -file aplha-secoandary.cer
It is exported to keystore file.
when I tried to sign the jar file it's giving the exception like
[signjar] jarsigner: Certificate chain not found for: must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain. jarsigner -keystore keystore.jks -storepass **** -keypass ****** Uploader.jar alpha-primary jarsigner: Certificate chain not found for: alpha-primary. alpha-primary must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain.
解决方案
I think that you are missing the private keys.For signing of jars is used asymmetrical encryption.Certificate contains only public key.
这篇关于未找到证书链的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!