Mac Code Signing: Bypass the Keychain Access priva

2020-07-05 06:26发布

问题:

I'm working on an app in Mac OS X Mountain Lion that needs to access the private key of some of my certificates within the Keychain Access. Since this app is going to run on a server, I need to avoid the pop up dialog that requires the user to allow the app to access the private key:

I know that by clicking "Always Allow" the dialog won't popup anymore for that private key, the problem is that I will be working with different keys.

Thanks in advance,

Mikywan.

回答1:

The only way I found to solve this is by setting up the Private Key in the Keychain Access to "Allow all applications to access this item".

You can configure this from the Terminal when you import the certificate into your Keychain.

Import command: import inputfile [-k keychain] [-t type] [-f format] [-w] [-P passphrase] [options...]

To set the access control to "Allow all applications to access this item", just add the flag "-A".

You can check always Apple's manual on security

Hope this helps.