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: opening smart card keychains



--On May 10, 2006 3:54:27 PM -0500 Cole Barnes <email@hidden> wrote:

I am calling SecKeychainCopySearchList() first; it's my understanding
that when this function is called, it gives you back the search list
used by Keychain Access.  Does this include all keychains shown by
Keychain Access?

Yes. (Or rather, Keychain Access just shows you the output of this function.)


I then take that search list and pass it to SecIdentitySearchCreate()
and loop through the results using SecIdentitySearchCopyNext() to get
my identities.  [...]

Note (to all of you) that this isn't a very good idea. If you want a keychain operation to use the user's search list, pass NULL as the keychain argument. This will automatically use what SecKeychainCopySearchList would have returned.


If you make your own list and pass it, then you won't be tracking changes to the list... such as smartcards appearing and disappearing. Yes, sometimes it may take a little while for these changes to propagate through the system. Why take the chance?

If you absolutely need to keep an up-to-date list of the user's keychains, then be sure to register for keychain-list-changed (keychain) notifications and refetch the list whenever you get one.

Cheers
 -- perry
---------------------------------------------------------------------------
Perry The Cynic                                             email@hidden
To a blind optimist, an optimistic realist must seem like an Accursed Cynic.
---------------------------------------------------------------------------

_______________________________________________
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: 
 >opening smart card keychains (From: "Cole Barnes" <email@hidden>)
 >Re: opening smart card keychains (From: Perry The Cynic <email@hidden>)
 >Re: opening smart card keychains (From: "Cole Barnes" <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.