[我正在阅读Apple的配置文件参考,https://developer.apple.com/business/documentation/Configuration-Profile-Reference.pdf,并在第65页上指出,CodeRequirement
身份词典密钥应为通过命令codesign -display -r -
获得的字符串:
但是,我无法将这些选项传递给我的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
?
结果是缺少一个破折号:
> 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