]> git.saurik.com Git - apple/security.git/blob - Keychain/SecKeychainSearch.h
Security-179.tar.gz
[apple/security.git] / Keychain / SecKeychainSearch.h
1 /*
2 * Copyright (c) 2000-2002 Apple Computer, Inc. All Rights Reserved.
3 *
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
8 * using this file.
9 *
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
16 */
17
18 /*!
19 @header SecKeychainSearch
20 The functions provided in SecKeychainSearch implement a query of one or more keychains to search for a particular SecKeychainItem.
21 */
22
23 #ifndef _SECURITY_SECKEYCHAINSEARCH_H_
24 #define _SECURITY_SECKEYCHAINSEARCH_H_
25
26 #include <Security/SecKeychainItem.h>
27
28
29 #if defined(__cplusplus)
30 extern "C" {
31 #endif
32
33 /*!
34 @function SecKeychainSearchGetTypeID
35 @abstract Returns the type identifier of SecKeychainSearch instances.
36 @result The CFTypeID of SecKeychainSearch instances.
37 */
38 CFTypeID SecKeychainSearchGetTypeID(void);
39
40 /*!
41 @function SecKeychainSearchCreateFromAttributes
42 @abstract Creates a search reference matching a list of zero or more specified attributes in the specified keychain.
43 @param keychainOrArray An reference to an array of keychains to search, a single keychain or NULL to search the user's default keychain search list.
44 @param itemClass The keychain item class.
45 @param attrList A pointer to a list of zero or more keychain attribute records to match. Pass NULL to match any keychain attribute.
46 @param searchRef On return, a pointer to the current search reference. You are responsible for calling the CFRelease function to release this reference when finished with it.
47 @result A result code. See "Security Error Codes" (SecBase.h).
48 */
49 OSStatus SecKeychainSearchCreateFromAttributes(CFTypeRef keychainOrArray, SecItemClass itemClass, const SecKeychainAttributeList *attrList, SecKeychainSearchRef *searchRef);
50
51 /*!
52 @function SecKeychainSearchCopyNext
53 @abstract Finds the next keychain item matching the given search criteria.
54 @param searchRef A reference to the current search criteria. The search reference is created in the SecKeychainSearchCreateFromAttributes function and must be released by calling the CFRelease function when you are done with it.
55 @param itemRef On return, a pointer to a keychain item reference of the next matching keychain item, if any.
56 @result A result code. When there are no more items that match the parameters specified to SecPolicySearchCreate, errSecItemNotFound is returned. See "Security Error Codes" (SecBase.h).
57 */
58 OSStatus SecKeychainSearchCopyNext(SecKeychainSearchRef searchRef, SecKeychainItemRef *itemRef);
59
60 #if defined(__cplusplus)
61 }
62 #endif
63
64 #endif /* !_SECURITY_SECKEYCHAINSEARCH_H_ */