Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What to do when there is no "default" keychain



Thank you (and all others who responded to my question) for your prompt and informative response.

See below for more information about problems with making "login" keychain - default.

On Sep 19, 2006, at 10:32 PM, Ken McLeod wrote:


On Sep 17, 2006, at 11:48 AM, Andrei Tchijov wrote:

Will passing "nil" in place of keychain in APIs like SecKeychainFindInternetPassword/SecKeychainItemCreateFromContent will work in situation where there is NO default keychain?

I should point out that passing NULL as the keychain argument when the default keychain does not exist will automatically prompt the user to create a new default keychain, *if* the API is one that would attempt to store an item in the keychain. SecKeychainCopyDefault() returns an error when there isn't a default, but if you subsequently try to store an item in the default keychain (specified by passing NULL), you'll get UI to create a new keychain, assuming your code is running in a UI- capable session.


P.S. On a separate but related subject, I have a customer who some how end-up in the "no default keychain" situation (My application gets -25307 from SecKeychainCopyDefault and none of keychains shown in "bold" in "Keychain Access"). However, when he is trying to apply "make default keychain" to his login keychain, he can not. The menu item is grayed out. So the question is: what could prevent "make default keychain" action from been available and how to fix it ( "keychain first aid" does not report any problems with his setup).

Is this on Panther, or Tiger?


It is Tiger.


The menu item is dimmed if Keychain Access thinks that the selected keychain is already the default. It might also be dimmed if the selected keychain can't be found on disk, or is not owned by the current user.


If the file ~/Library/Preferences/com.apple.security.plist exists, move it aside and relaunch Keychain Access. If that fixes the problem, please file a bug and include the contents of the plist file. (Note that the plist file might *not* exist, in which case ~/ Library/Keychains/login.keychain is assumed to be the default.)


~/Library/Preferences/com.apple.security.plist did exist, but removing of it did not make any difference( I asked my customer to e- mail me the content of the file, but have not heard back from him yet). In the end, creating new keychain, making it default fixed the problem (that is, my customer was able to make "login" keychain default once he had some other default keychain).



-ken


_______________________________________________ Do not post admin requests to the list. They will be ignored. Apple-cdsa mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/apple-cdsa/email@hidden

This email sent to email@hidden
References: 
 >What to do when there is no "default" keychain (From: Andrei Tchijov <email@hidden>)
 >Re: What to do when there is no "default" keychain (From: Ken McLeod <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.