Is it possible to link Private Keys and Certificates across Keychains?

Solution 1:

It is not possible to link private keys and certificates across multiple Keychains. There needs be a third hidden item called an identity that bonds these two items together. The identity, certificate, and private key need to be in the same Keychain.

Specify the Keychain

Using Keychain Access, create a separate Keychain with a certificate and private key in each. In your situation this will mean creating two separate keychains.

Tell codesign to look for your specific Keychain using the command line option --keychain; the path provided to the Keychain must be absolute.

You can provide this option and path to codesign within Xcode through the build settings user interface.