Bug 4240 - We need an option to allow Detecting Signing Identity for another keychain.
Summary: We need an option to allow Detecting Signing Identity for another keychain.
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: iOS add-in ()
Version: unspecified
Hardware: Macintosh Mac OS
: High enhancement
Target Milestone: ---
Assignee: Jeffrey Stedfast
Depends on:
Reported: 2012-04-04 14:53 UTC by James Clancey
Modified: 2013-03-08 19:24 UTC (History)
5 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description James Clancey 2012-04-04 14:53:38 UTC
We've got 2 separate keychains for Entеrprise and AppStore builds with the same Signing Identity.

The fact that the signing identity is the same makes it impossible to export both certificates/private keys to the login keychain simultaneously. Which makes automatic build process useless.

We're able to sign the build from a standalone keychain using "codesign --keychain...", but the build process fails before compilation on "Detecting Signing Identity..." step, this seems to happen because it check only login keychain for presence of the certificates/keys.

So the question is: Can we enable the "Detecting Signing Identity..." step to check other keychains?
Alternatively: Can we disable the "Detecting Signing Identity..." step before compilation?
Comment 1 Sebastien Pouliot 2012-04-04 16:53:59 UTC
Signing step occurs inside the MonoDevelop addin
Comment 2 Mikayla Hutchinson [MSFT] 2012-04-17 14:06:51 UTC
Maybe the best approach for this is for MD to enumerate identities from all keychains, and show them in the signing key dropdown.
Comment 3 Jeffrey Stedfast 2012-04-24 15:50:01 UTC
There does not appear to be an API to get a list of all keychains, there are only APIs to open a keychain based on a path (so we need to know the path of the keychain file ahead of time).

Sadly, all of the SecIdentity*() APIs are deprecated now, also... but the docs do not provide any hint on where to look for the newer APIs to get identities from a keychain. Yay.

I think we'll have to just have a file selector UI element to select which keychain to use.
Comment 4 Jeffrey Stedfast 2012-04-26 16:59:45 UTC
Clancey: how do you do this in Xcode? Maybe we can copy Xcode's UI.

And how do you add keys to the non-default keychain?
Comment 5 James Clancey 2012-04-26 17:12:49 UTC
You essentially get a huge dropdown

At the bottom of the dropdown there is Other

It is a free text entry.
Comment 6 Jeffrey Stedfast 2012-04-26 17:16:35 UTC
hmmm, aren't those all from the same keychain, though?

I was more hoping for a UI that allowed the user to enter a keychain that they wanted to use.
Comment 7 Mikayla Hutchinson [MSFT] 2012-04-26 18:10:55 UTC
We could pull the list of keychains from Keychain Manager's settings: ~/Library/Preferences/com.apple.security.plist
Comment 8 Mikayla Hutchinson [MSFT] 2012-04-26 18:11:43 UTC
Seems to be documented at  https://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages/man1/security.1.html
Comment 9 Mikayla Hutchinson [MSFT] 2012-04-26 20:07:11 UTC
According to Keychain Services reference docs, the API we're using gets identities from all keychains in the search path, so we should be considering identities from all registered keychains already, we just won't disambiguate them when signing.

Is the keychain registered in Keychain Manager?

If you use an explicit provisioning profile and automatic signing identity, MD should be able to resolve the identity. It'll still fail to sign, but we can fix that by passing the thumbprint to codesign, instead of passing the common name. But you should be able to get an unsigned app bundle.
Comment 10 Jeffrey Stedfast 2013-03-08 19:24:55 UTC
I've been doing Enterprise and non-Enterprise signing for a while now