Code signing 使用PFX文件与jarsigner对jar进行签名
我所做的工作如下:Code signing 使用PFX文件与jarsigner对jar进行签名,code-signing,pki,jarsigner,Code Signing,Pki,Jarsigner,我所做的工作如下: 创建ca.key和ca.cert 创建server.key和server.csr 与CA签署CSR,创建server.cert 使用server.cert和server.key创建pfx 所有这些都是使用OpenSSL实现的 现在我想使用jarsigner用这个PFX文件对一个JAR文件进行签名 $jarsigner-storetype pkcs12-keystore certificate.pfx myJAR.jar我的别名 我得到: jar signed. Warnin
ca.key
和ca.cert
server.key
和server.csr
server.cert
server.cert
和server.key
创建pfx
$jarsigner-storetype pkcs12-keystore certificate.pfx myJAR.jar我的别名
我得到:
jar signed.
Warning:
The signer's certificate chain is invalid. Reason: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
No -tsa or -tsacert is provided and this jar is not timestamped. Without a timestamp, users may not be able to validate this jar after the signer certificate's expiration date (2022-05-12) or after any future revocation date.
The signer certificate will expire on 2022-05-12.
我在验证jar时也会得到这个。我猜这是因为没有任何东西告诉JRE信任签署这个JAR的证书的CA,但我不确定。什么是证书链
请提供帮助。X.509证书可用于各种用途。证书中的
keyUsage
和extendedKeyUsage
扩展标识其预期用途。当证书使用某些密钥用法颁发时,您只能使用其公钥执行这些密码操作。如果您试图执行任何其他不受支持的操作,则执行密码操作的库将对此进行投诉。您可以找到标准的键用法
用于代码签名目的的证书应包含数字签名
密钥用法。你可以阅读更多关于这方面的内容
因此,在您的情况下,它是以下其中之一:
digitalSignature
keyUsage的证书,(或)digitalSignature
keyUsage,则CA未正确配置以颁发数字签名证书(可能未添加所需的必要属性)数字签名
扩展(或者)如果CA不接受来自您的CSR的扩展,那么您需要弄清楚如何向CA申请数字签名证书