]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_keychain/lib/SecPolicySearch.h
Security-57337.20.44.tar.gz
[apple/security.git] / OSX / libsecurity_keychain / lib / SecPolicySearch.h
1 /*
2 * Copyright (c) 2002-2004,2011,2014 Apple Inc. All Rights Reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24 /*!
25 @header SecPolicySearch
26 The functions provided in SecPolicySearch implement a query for SecPolicy objects.
27 */
28
29 #ifndef _SECURITY_SECPOLICYSEARCH_H_
30 #define _SECURITY_SECPOLICYSEARCH_H_
31
32 #include <Security/SecBase.h>
33 #include <Security/cssmtype.h>
34
35
36 #if defined(__cplusplus)
37 extern "C" {
38 #endif
39
40 CF_ASSUME_NONNULL_BEGIN
41
42 /*!
43 @typedef SecPolicySearchRef
44 @abstract A reference to an opaque policy search structure.
45 */
46 typedef struct CF_BRIDGED_TYPE(id) OpaquePolicySearchRef *SecPolicySearchRef;
47
48 /*!
49 @function SecPolicySearchGetTypeID
50 @abstract Returns the type identifier of SecPolicySearch instances.
51 @result The CFTypeID of SecPolicySearch instances.
52 @discussion This API is deprecated in 10.7. The SecPolicySearchRef type is no longer used.
53 */
54 CFTypeID SecPolicySearchGetTypeID(void)
55 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
56
57 /*!
58 @function SecPolicySearchCreate
59 @abstract Creates a search reference for finding a policy by specifying its object identifier.
60 @param certType The type of certificates a policy uses.
61 @param policyOID A pointer to a BER-encoded policy object identifier that uniquely specifies the policy.
62 @param value Unused. Pass NULL for this value. Use SecPolicySetValue to set per policy data.
63 @param searchRef On return, a pointer to a policy search reference. The policy search reference is used for subsequent calls to the SecCopyNextPolicy function to obtain the remaining trust policies. You are responsible for releasing the search reference by calling the CFRelease function when finished with it.
64 @result A result code. See "Security Error Codes" (SecBase.h).
65 @discussion This function is deprecated in 10.7. To create a SecPolicyRef, use one of the SecPolicyCreate functions in SecPolicy.h.
66 */
67 OSStatus SecPolicySearchCreate(CSSM_CERT_TYPE certType, const CSSM_OID *policyOID, const CSSM_DATA * __nullable value, SecPolicySearchRef * __nonnull CF_RETURNS_RETAINED searchRef)
68 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
69
70 /*!
71 @function SecPolicySearchCopyNext
72 @abstract Finds the next policy matching the given search criteria
73 @param searchRef A reference to the current policy search criteria. You create the policy search reference by a calling the SecPolicySearchCreate function. You are responsible for releasing the policy by calling the CFRelease function when finished with it.
74 @param policyRef On return, a pointer to a policy reference.
75 @result A result code. When there are no more policies that match the parameters specified to SecPolicySearchCreate, errSecPolicyNotFound is returned. See "Security Error Codes" (SecBase.h).
76 @discussion This function is deprecated in 10.7. To create a SecPolicyRef, use one of the SecPolicyCreate functions in SecPolicy.h.
77 */
78 OSStatus SecPolicySearchCopyNext(SecPolicySearchRef searchRef, SecPolicyRef * __nonnull CF_RETURNS_RETAINED policyRef)
79 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
80
81 CF_ASSUME_NONNULL_END
82
83 #if defined(__cplusplus)
84 }
85 #endif
86
87 #endif /* !_SECURITY_SECPOLICY_H_ */