0

I'm reading Apple's Configuration Profile Reference, https://developer.apple.com/business/documentation/Configuration-Profile-Reference.pdf, and on page 65 it is stated that the CodeRequirement identity dictionary key should be a string obtained via the command codesign -display -r -:

enter image description here

However, I'm not able to pass these options to my codesign command-line app. codesign -d works, but just returns the path of the executable:

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

However, codesign -d -r doesn't work:

/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

How do I get the CodeRequirement for an app using the codesign command-line tool?

Kurt Peek
  • 52,165
  • 91
  • 301
  • 526

1 Answers1

0

It turns out a dash was missing:

> 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
Kurt Peek
  • 52,165
  • 91
  • 301
  • 526