Codesign error - SecKey API returned: -67671

2019-07-03 22:37发布

问题:

When I try to run codesign of a particular app, I get an error:

/Users/xxx/xxxxxx/xxxxx.app: replacing existing signature

SecKey API returned: -67671 (null)/Users/xxx/xxxxxx/xxxxx.app

unknown error -1=ffffffffffffffff

Any idea what this means?

回答1:

In my case needed to do the following:

  1. in the Keychain Access right click on the Private Key (if it is not seen, expand the Certificate by clicking on the little triangle near it)

  2. Choose Get Info

  3. Go to Access Control tab, choose "Allow all applications to access this item"

  4. Click Save changes button, input the username/passwords if prompted

Also note the Certificate/Key could be not only in you login keychain, but also in the System keychain. Do the same for both if required.