3

我正在使用这个命令行签署我的 mac 包:

Volumes/Auxiliary\ Tools/PackageMaker.app/Contents/MacOS/PackageMaker \
--sign /Users/company/src/clients/linux-client/mac/company_client_installer.pkg \
--certificate "Developer ID Application: company"

签名有效,但安装失败并出现错误。这是 install.log 中的相关部分:

Oct 16 16:59:33 mac installd[57355]: PackageKit: Install Failed: Error Domain=PKInstallErrorDomain Code=102 "The package “company_client_installer.pkg” is untrusted." UserInfo=0x106a2be30 {NSLocalizedDescription=The package “company_client_installer.pkg” is untrusted., NSURL=file://localhost/Users/company/src/clients/linux-client/mac/company_client_installer.pkg#companyClient.pkg, PKInstallPackageIdentifier=com.company.company_client_installer.pkg, NSUnderlyingError=0x7ffd2a52c900 "The operation couldn’t be completed. CSSMERR_TP_NOT_TRUSTED"} {
1674             NSLocalizedDescription = "The package \U201ccompany_client_installer.pkg\U201d is untrusted.";
1675             NSURL = "file://localhost/Users/company/src/clients/linux-client/mac/company_client_installer.pkg#companyClient.pkg";
1676             NSUnderlyingError = "Error Domain=NSOSStatusErrorDomain Code=-2147409622 \"The operation couldn\U2019t be completed. CSSMERR_TP_NOT_TRUSTED\" UserInfo=0x7ff     d2a5573b0 {SecTrustResult=5, PKTrustLevel=PKTrustLevelNotTrusted, NSLocalizedFailureReason=CSSMERR_TP_NOT_TRUSTED}";
1677             PKInstallPackageIdentifier = "com.company.company_client_installer.pkg";

如果我使用 pkgutil 检查签名,它会返回:

pkgutil --check-signature company_client_installer.pkg
Package "company_client_installer.pkg":
  Status: signed by a certificate trusted by Mac OS X
  Certificate Chain:
    1. Developer ID Application: company
    2. Developer ID Certification Authority
    3. Apple Root CA

我尝试在“钥匙串访问”中评估我的证书,它报告“没有找到根证书”,但用绿色复选标记表示证书为“有效”。

我现在完全糊涂了。我在这里做错了什么?任何想法?

沃尔克

4

1 回答 1

0

我不确定您的错误,但是,我知道您需要使用 Developer ID 安装程序证书来签署您的包。

这是我使用的命令:

productsign --sign "开发者 ID 安装程序:ACME, Inc (ABCDEFGHIJK)" source.pkg destination.pkg

您还可以使用以下命令验证您的包:

spctl -a -vvvv --type install MyInstaller.pkg

于 2016-07-13T11:42:05.133 回答