Is it somehow possible to get my Developer ID Certificate via a shell command or via the System.Keychain module?
I tried but no success so far.
What I try to do is making a simple code signing app. I can find the certificate in Apple’s Keychain application.
But I would rather find the keychain name programmatically.
The easiest way is to use a Shell to execute your the command and tell the keychain that your app doesnt need a password to use the certificate.
I don’t think I fully understand you.
When you run the shell command macOS will popup a dialog box requesting your approval. In this dialog click the Always button.
Ill give you some pointers, enough to go figure out what you need, but by no means enough to copy and paste as youre creating a competitor to App Wrapper and some of this stuff, took years for me to figure out.
You need to use declares (or MBS) to read the code signing identities from the Keychain, you can search for valid identities and get returned an object from which you can then extract the code signing certificate and from that you can get the display name.
You do NOT want to search the keychain for certificates, as certificates alone is false information. To be able to code sign you need more than just a certificate, which is where identities come in.