1/*
2 * Copyright (c) 2002-2004 Apple Computer, 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)
37extern "C" {
38#endif
39
40/*!
41	@typedef SecPolicySearchRef
42	@abstract A reference to an opaque policy search structure.
43*/
44typedef struct OpaquePolicySearchRef *SecPolicySearchRef;
45
46/*!
47	@function SecPolicySearchGetTypeID
48	@abstract Returns the type identifier of SecPolicySearch instances.
49	@result The CFTypeID of SecPolicySearch instances.
50	@discussion This API is deprecated in 10.7. The SecPolicySearchRef type is no longer used.
51*/
52CFTypeID SecPolicySearchGetTypeID(void)
53		DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
54
55/*!
56	@function SecPolicySearchCreate
57	@abstract Creates a search reference for finding a policy by specifying its object identifier.
58	@param certType The type of certificates a policy uses.
59    @param policyOID A pointer to a BER-encoded policy object identifier that uniquely specifies the policy.
60	@param value Unused.  Pass NULL for this value.  Use SecPolicySetValue to set per policy data.
61	@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.
62    @result A result code.  See "Security Error Codes" (SecBase.h).
63	@discussion This function is deprecated in 10.7. To create a SecPolicyRef, use one of the SecPolicyCreate functions in SecPolicy.h.
64*/
65OSStatus SecPolicySearchCreate(CSSM_CERT_TYPE certType, const CSSM_OID *policyOID, const CSSM_DATA *value, SecPolicySearchRef *searchRef)
66		DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
67
68/*!
69	@function SecPolicySearchCopyNext
70	@abstract Finds the next policy matching the given search criteria
71	@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.
72	@param policyRef On return, a pointer to a policy reference.
73	@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).
74	@discussion This function is deprecated in 10.7. To create a SecPolicyRef, use one of the SecPolicyCreate functions in SecPolicy.h.
75*/
76OSStatus SecPolicySearchCopyNext(SecPolicySearchRef searchRef, SecPolicyRef *policyRef)
77		DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
78
79#if defined(__cplusplus)
80}
81#endif
82
83#endif /* !_SECURITY_SECPOLICY_H_ */
84