]>
git.saurik.com Git - apple/security.git/blob - sec/Security/SecPolicy.h
2 * Copyright (c) 2007-2010 Apple Inc. All Rights Reserved.
4 * @APPLE_LICENSE_HEADER_START@
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
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.
21 * @APPLE_LICENSE_HEADER_END@
26 The functions provided in SecPolicy.h provide an interface to various
27 X.509 certificate trust policies.
30 #ifndef _SECURITY_SECPOLICY_H_
31 #define _SECURITY_SECPOLICY_H_
33 #include <Security/SecBase.h>
34 #include <CoreFoundation/CFBase.h>
36 #if defined(__cplusplus)
42 @abstract CFType representing a X.509 certificate trust policy.
44 typedef struct __SecPolicy
*SecPolicyRef
;
47 @function SecPolicyGetTypeID
48 @abstract Returns the type identifier of SecPolicy instances.
49 @result The CFTypeID of SecPolicy instances.
51 CFTypeID
SecPolicyGetTypeID(void)
52 __OSX_AVAILABLE_STARTING(__MAC_10_3
, __IPHONE_2_0
);
55 @function SecPolicyCreateBasicX509
56 @abstract Returns a policy object for the default X.509 policy.
57 @result A policy object. The caller is responsible for calling CFRelease
58 on this when it is no longer needed.
60 SecPolicyRef
SecPolicyCreateBasicX509(void)
61 __OSX_AVAILABLE_STARTING(__MAC_10_6
, __IPHONE_2_0
);
64 @function SecPolicyCreateSSL
65 @abstract Returns a policy object for evaluating SSL certificate chains.
66 @param server Passing true for this parameter create a policy for SSL
68 @param hostname Optional; if present, the policy will require the specified
69 hostname to match the hostname in the leaf certificate.
70 @result A policy object. The caller is responsible for calling CFRelease
71 on this when it is no longer needed.
73 SecPolicyRef
SecPolicyCreateSSL(Boolean server
, CFStringRef hostname
)
74 __OSX_AVAILABLE_STARTING(__MAC_10_6
, __IPHONE_2_0
);
76 #if defined(__cplusplus)
80 #endif /* !_SECURITY_SECPOLICY_H_ */