18

I need to know exactly what my codesign identity is. Where can I find that? And what is the usual format for a codesign identity? Thank you!

SirRupertIII
  • 12,324
  • 20
  • 72
  • 121

4 Answers4

55

You can run following command in your terminal to get a list of all codesign identities installed on your system:

security find-identity -v -p codesigning

The output will contain lines like:

1) 482348ADF834384843884934734 "iPhone Developer: John Smith (YTHGJFKTHG)"
2) 49u343943943943494387348738 ...

where the first part (482348ADF834384843884934734) is your codesign identity, which is passed as an argument to the --sign flag of codesign tool.

Taras Tsugrii
  • 832
  • 6
  • 5
6

In Xcode, you can access the Code Signing Identity by selecting your target, going to build settings and it's right under "Code Signing Identity".

For more information, you can access Apple's Documentation.

Sean Wei
  • 7,433
  • 1
  • 19
  • 39
VGruenhagen
  • 1,487
  • 15
  • 28
4

On macOS 11 Big Sur, @Taras answer above does not return any identities. However, by removing -v for verbose, it does, and while it doesn't make any sense:

λ security find-identity -v -p codesigning
     0 valid identities found

λ security find-identity -p codesigning

Policy: Code Signing
  Matching identities
  1) B21272CXXXXXXCDBC562C0E0XXXXXX89 "Apple Development: Haakon Storm Heen (9X9X3XKX5X)"
     1 identities found

  Valid identities only
     0 valid identities found
  • 1
    In this case `-v` is not for _verbose_ but it means that only _valid_ identities should be displayed. – Oldes Sep 08 '21 at 13:51
  • Wow, thank you @Oldes for the correction. Depending on context `-v` can mean verify but also verbose. How odd. Thanks for pointing this out. – haakonstorm Sep 09 '21 at 14:04
-2

Also, you can find it in the full name of installer certificate. Run KeyChain app, find you (e.g Mac Developer) certificate with name like "3rd Party Mac Developer Application: DUMMY INC (NJ2XXXXXXX)", the "NJ2XXXXXXX" will your codesign identity.

broderix
  • 385
  • 4
  • 9