上次更新時間
2023年5月24日
公證可確保您所發佈的開發者 ID 簽署軟體已通過 Apple 的惡意元件檢查。如需有關 Apple 公證規則和需求的詳細資訊,請參閱在發佈 macOS 軟體前完成公證程序。
為符合 Apple 的公證規則,InDesign 2020 已啟用強化的執行階段權限,可讓第三方外掛程式載入 InDesign,而不需要對其進行程式碼簽署。不過,外掛程式開發者通常會透過安裝程式 (.pkg 或 .dmg) 在網頁上發佈外掛程式。由於 Apple 在 macOS 上的 Gatekeeper 會自動隔離未經公證的所有二進位檔,因此您的外掛程式安裝程式將無法順利執行。如需詳細資訊,請參閱 InDesign 和 macOS 10.15 (Catalina)。 正因如此,即使 InDesign 外掛程式不需要任何公證程序或程式碼簽署,也仍然需要對外掛程式安裝程式/二進位檔進行公證。
公證需求
- Apple Developer 帳號
- Xcode 10 或更新版本
- 應用程式專屬密碼。以下是產生密碼的指示。
憑證產生程序
- 要求憑證 (「鑰匙圈存取」選單 >「憑證輔助程式」>「從憑證授權要求憑證」)
- 將 .certSigningRequest 檔案儲存至磁碟。
- 登入 Apple Developer 入口網站。
- 按一下「Certificates, Identifiers & Profiles」。
- 選擇「Developer ID Application」,以建立新的憑證。
- 上傳步驟 1 的 .certSigningRequest 檔案並完成程序。將顯示的 .cer 檔案下載至磁碟。
- 選擇「Developer ID Installer」,然後重複步驟 4 至 6。
- 上傳與步驟 1 相同的 .certSigningRequest 檔案並完成程序。將顯示的 .cer 檔案下載至磁碟。
- 按兩下步驟 6 和 8 下載的 .cer 憑證,以將其匯入至「鑰匙圈」。
適用於 .pkg 或 .dmg 檔案的公證步驟
此範例使用 SDK 的 BasicDialog 範例外掛程式。
# 對 .InDesignPlugin 進行程式碼簽署
codesign --sign "Developer ID Application: <Developer Name>" --verbose=4 --deep --force --strict BasicDialog.InDesignPlugin # 程式碼簽署驗證
codesign -dv --verbose=4 BasicDialog.InDesignPlugin - # 將上述已進行程式碼簽署的 .InDesignPlugin 新增至套件/安裝程式,以建立 .pkg 或 .dmg
# 簽署您的安裝程式 (例如 .dmg 或 .pkg)
productsign --sign "Developer ID Installer: <Developer Name>" ./BasicDialog.pkg ./BasicDialogSigned.pkg # 程式碼簽署驗證
pkgutil --check-signature BasicDialogSigned.pkg # 傳送以供公證
xcrun altool --notarize-app --primary-bundle-id "com.demo.plugin" --username "your-apple-id@xyz.com" --password "xxxx-xxxx-xxxx-xxxx" --file BasicDialogSigned.pkg # 線上檢查公證狀態 (步驟 6 應傳回請求 UID)
xcrun altool --notarization-info <Request UID> --username "your-apple-id@xyz.com" --password "xxxx-xxxx-xxxx-xxxx" # 裝訂已公證的檔案以供離線使用
xcrun stapler staple BasicDialogSigned.pkg # 檢查是否有裝訂器
stapler validate --verbose BasicDialogSigned.pkg