objc2_security/generated/SecKeychainSearch.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2_core_foundation::*;
5
6use crate::*;
7
8#[cfg(feature = "SecBase")]
9unsafe impl ConcreteType for SecKeychainSearch {
10 /// Returns the type identifier of SecKeychainSearch instances.
11 ///
12 /// Returns: The CFTypeID of SecKeychainSearch instances.
13 ///
14 /// This API is deprecated in 10.7. The SecKeychainSearchRef type is no longer used.
15 #[doc(alias = "SecKeychainSearchGetTypeID")]
16 #[inline]
17 fn type_id() -> CFTypeID {
18 extern "C-unwind" {
19 fn SecKeychainSearchGetTypeID() -> CFTypeID;
20 }
21 unsafe { SecKeychainSearchGetTypeID() }
22 }
23}
24
25extern "C-unwind" {
26 /// Creates a search reference matching a list of zero or more specified attributes in the specified keychain.
27 ///
28 /// Parameter `keychainOrArray`: An reference to an array of keychains to search, a single keychain or NULL to search the user's default keychain search list.
29 ///
30 /// Parameter `itemClass`: The keychain item class.
31 ///
32 /// Parameter `attrList`: A pointer to a list of zero or more keychain attribute records to match. Pass NULL to match any keychain attribute.
33 ///
34 /// Parameter `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.
35 ///
36 /// Returns: A result code. See "Security Error Codes" (SecBase.h).
37 ///
38 /// This function is deprecated in Mac OS X 10.7 and later; to find keychain items which match specified attributes, please use the SecItemCopyMatching API (see SecItem.h).
39 #[cfg(all(feature = "SecBase", feature = "SecKeychainItem"))]
40 #[deprecated = "SecKeychainSearch is not supported"]
41 pub fn SecKeychainSearchCreateFromAttributes(
42 keychain_or_array: Option<&CFType>,
43 item_class: SecItemClass,
44 attr_list: *const SecKeychainAttributeList,
45 search_ref: NonNull<*mut SecKeychainSearch>,
46 ) -> OSStatus;
47}
48
49extern "C-unwind" {
50 /// Finds the next keychain item matching the given search criteria.
51 ///
52 /// Parameter `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.
53 ///
54 /// Parameter `itemRef`: On return, a pointer to a keychain item reference of the next matching keychain item, if any.
55 ///
56 /// Returns: 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 /// This function is deprecated in Mac OS X 10.7 and later; to find keychain items which match specified attributes, please use the SecItemCopyMatching API (see SecItem.h).
59 #[cfg(feature = "SecBase")]
60 #[deprecated = "SecKeychainSearch is not supported"]
61 pub fn SecKeychainSearchCopyNext(
62 search_ref: &SecKeychainSearch,
63 item_ref: NonNull<*mut SecKeychainItem>,
64 ) -> OSStatus;
65}