如何使用代码签名获取应用程序的CodeRequirement?

问题描述 投票:0回答:1

[我正在阅读Apple的配置文件参考,https://developer.apple.com/business/documentation/Configuration-Profile-Reference.pdf,并在第65页上指出,CodeRequirement身份词典密钥应为通过命令codesign -display -r -获得的字符串:

enter image description here

但是,我无法将这些选项传递给我的codesign命令行应用程序。 codesign -d有效,但是只返回可执行文件的路径:

/Applications> codesign -d Slack.app
Executable=/Applications/Slack.app/Contents/MacOS/Slack

但是,codesign -d -r不起作用:

/Applications> codesign -d -r Slack.app
Usage: codesign -s identity [-fv*] [-o flags] [-r reqs] [-i ident] path ... # sign
       codesign -v [-v*] [-R=<req string>|-R <req file path>] path|[+]pid ... # verify
       codesign -d [options] path ... # display contents
       codesign -h pid ... # display hosting paths

如何使用CodeRequirement命令行工具获取应用程序的codesign

macos codesign
1个回答
0
投票

结果是缺少一个破折号:

> codesign -d -r - /Applications/Slack.app
Executable=/Applications/Slack.app/Contents/MacOS/Slack
designated => identifier "com.tinyspeck.slackmacgap" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = BQR82RBBHL
© www.soinside.com 2019 - 2024. All rights reserved.