驗證開發者簽章
以下步驟只使用 macOS 內建工具,確認下載的 DMG 沒有被替換、確實由指定開發者簽署,並通過 Apple Notary Service 公證。
Raidic 正確簽署者
Team Identifier:
Developer ID Application: Hung-En Hsieh (UM92U863A8)Team Identifier:
UM92U863A8
1下載 DMG 與 checksum
把兩個檔案下載到 Mac 的「下載項目」資料夾。
下載、安裝或使用 Raidic,即表示你已閱讀並同意使用條款。磁碟操作可能造成永久資料遺失;請先建立並測試獨立備份。
2確認檔案 SHA-256
打開「終端機」,執行:
cd "$HOME/Downloads" shasum -a 256 -c Raidic-0.1.3.dmg.sha256
Raidic-0.1.3.dmg: OK
也可以直接查看雜湊值:
shasum -a 256 "$HOME/Downloads/Raidic-0.1.3.dmg"
正確 SHA-256:
c0c197fcb0c48cd1b72b16e02bdcdf69a2dc93cc846cbe9ac2c85e7d62470f3d
3用 Gatekeeper 驗證簽署者與 Apple 公證
這是最重要的一步。spctl 會使用 macOS Gatekeeper 的規則驗證 DMG:
spctl --assess --type open \ --context context:primary-signature -vv \ "$HOME/Downloads/Raidic-0.1.3.dmg"
預期應同時看到 accepted、Notarized Developer ID,以及正確開發者:
Raidic-0.1.3.dmg: accepted source=Notarized Developer ID origin=Developer ID Application: Hung-En Hsieh (UM92U863A8)
4查看完整 Developer ID 憑證鏈
codesign 可顯示 DMG 的簽章 authority、Team ID 與時間戳:
codesign -dv --verbose=4 \ "$HOME/Downloads/Raidic-0.1.3.dmg" 2>&1 | \ grep -E '^(Authority|TeamIdentifier|Timestamp)='
Authority=Developer ID Application: Hung-En Hsieh (UM92U863A8) Authority=Developer ID Certification Authority Authority=Apple Root CA TeamIdentifier=UM92U863A8 Timestamp=…
5驗證 DMG 裡的 Raidic.app
掛載 DMG,再分別執行嚴格簽章驗證與 Gatekeeper App 驗證:
hdiutil attach "$HOME/Downloads/Raidic-0.1.3.dmg" APP="/Volumes/Raidic 0.1.3/Raidic.app" codesign --verify --deep --strict --verbose=2 "$APP" spctl --assess --type execute -vv "$APP" hdiutil detach "/Volumes/Raidic 0.1.3"
codesign 成功時不會顯示錯誤;spctl 預期結果:
Raidic.app: accepted source=Notarized Developer ID origin=Developer ID Application: Hung-En Hsieh (UM92U863A8)
如果結果不同,請不要開啟 App。
SHA-256 用來確認檔案內容;Developer ID 簽章確認簽署者;Gatekeeper 的
SHA-256 用來確認檔案內容;Developer ID 簽章確認簽署者;Gatekeeper 的
Notarized Developer ID 則確認 Apple 已接受該版本。三者用途不同,不能互相取代。