4

ターミナルから「productsign」コマンドを使用して署名した Mac アプリがあります。

productsign --sign "3rd Party Mac Developer Installer: My company (dasdfjkaj)" InstallerUnsigned.pkg InstallerSigned.pkg

productsign: signing product with identity "3rd Party Mac Developer Installer: My company (dasdfjkaj)" from keychain /Users/me/Library/Keychains/login.keychain
productsign: adding intermediate certificate "Apple Worldwide Developer Relations Certification Authority"
productsign: Wrote signed product archive to InstallerSigned.pkg

次に、assess コマンドを実行しました

spctl -a -v --type install  InstallerSigned.pkg
InstallerSigned.pkg: accepted

サインも確認しました

pkgutil --check-signature InstallerSigned.pkg 
Package "InstallerSigned.pkg":
Status: signed by a developer certificate issued by Apple
   Certificate Chain:
    1. 3rd Party Mac Developer Installer: My company (dasdfjkaj)
    2. Apple Worldwide Developer Relations Certification Authority
    3. Apple Root CA

自分のマシンからインストーラーを実行すると (Gatekeeper を「Mac App Store と識別された開発者」に設定)、正常に動作します。Web サイトにデプロイした後に同じ pkg をダウンロードしたときにも、正しくインストールされました。

しかし...別のマシンでpkgをダウンロードすると、インストールに失敗します。開発者 ID が認識されません。障害が発生したマシンで spctl コマンドを実行すると、

spctl -a -v --type install  InstallerSigned.pkg
InstallerSigned.pkg: rejected

自分のマシンでは問題なく動作するのに、別のマシンで pkg を実行すると失敗する理由を知っている人はいますか? 私は本当にすべてのアイデアがありません:/

編集:これは私が得るものです

spctl --list --type execute
3[Apple System] P0 allow execute
    anchor apple
4[Mac App Store] P0 allow execute
    anchor apple generic and certificate leaf[field.<I removed this>] exists
5[Developer ID] P0 allow execute
    anchor apple generic and certificate 1[field.<I removed this>] exists and certificate leaf[field.<I removed this>] exists
7[GKE] P0 allow execute [(gke)]
    cdhash H"<I removed this>"
10[GKE] P0 allow execute [(gke)]
    cdhash H"<I removed this>"
14[GKE] P0 allow execute [(gke)]
    cdhash H"<I removed this>"
15[GKE] P0 allow execute [(gke)]
    cdhash H"<I removed this>"
18[GKE] P0 allow execute [(gke)]
4

1 に答える 1

5

証明書の重要性

これらは、コード署名のために一緒に使用する必要がある証明書です:

  • 開発者 ID インストーラー
  • 開発者ID申請書

    • サードパーティ Mac デベロッパー インストーラー(通常は AppStore アプリでのみ使用されます)。

" Developer ID Installer " 証明書は、AppStore に提出しない場合に使用するものです。具体的にコード署名部分については、「Developer ID Application」証明書を使用する必要があります。

Apple Developer Codesigning ワークフロー ガイド

于 2014-01-22T23:17:51.250 に答える