Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac Code Signing: Bypass the Keychain Access private key prompt from Terminal

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:

Pop up dialog

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.

like image 540
mikywan Avatar asked Feb 06 '13 16:02

mikywan


1 Answers

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".

Private Key Properties: Access Control

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.

like image 56
mikywan Avatar answered Dec 14 '22 23:12

mikywan