]> git.saurik.com Git - apple/libsecurity_codesigning.git/blob - lib/SecCodeHostLib.h
libsecurity_codesigning-36924.tar.gz
[apple/libsecurity_codesigning.git] / lib / SecCodeHostLib.h
1 /*
2 * Copyright (c) 2007 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 SecCodeHostLib
26 This header provides a subset of the hosting API for Code Signing.
27 This subset functionality is implemented as a static library written
28 entirely in C, and depends on nothing except the system library and the
29 C runtime. It is thus suitable to be used by low-level libraries and
30 other such system facilities. On the other hand, it does not provide the
31 full functionality of <Security/SecCodeHost.h>.
32
33 This file is documented as a delta to <Security/SecCodeHost.h>, which
34 you should consult as a baseline.
35 */
36 #ifndef _H_SECCODEHOSTLIB
37 #define _H_SECCODEHOSTLIB
38
39 //#include <Security/SecCodeHost.h>
40 #include "SecCodeHost.h"
41 #include <System/sys/codesign.h>
42
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46
47
48 /*!
49 @function SecHostLibInit
50 This function must be called first to use the SecCodeHostLib facility.
51 */
52 OSStatus SecHostLibInit(SecCSFlags flags);
53
54
55 /*!
56 @function SecHostLibCreateGuest
57 This function declares a code host, engages hosting proxy services for it,
58 and creates a guest with given attributes and state.
59
60 NOTE: This version of the function currently only supports dedicated hosting.
61 If you do not pass the kSecCSDedicatedHost flag, the call will fail.
62 */
63 OSStatus SecHostLibCreateGuest(SecGuestRef host,
64 uint32_t status, const char *path, const char *attributeXML,
65 SecCSFlags flags, SecGuestRef *newGuest);
66
67
68 /*!
69 @function SecHostLibSetGuestStatus
70 This function can change the state or attributes (or both) of a given guest.
71 It performs all the work of SecHostSetGuestStatus.
72 */
73 OSStatus SecHostLibSetGuestStatus(SecGuestRef guestRef,
74 uint32_t status, const char *attributeXML,
75 SecCSFlags flags);
76
77
78 /*!
79 @function SecHostLibSetHostingPort
80 Register a Mach port to receive hosting queries on. This enables (and locks)
81 dynamic hosting mode, and is incompatible with all proxy-mode calls.
82 You still must call SecHostLibInit first.
83 */
84 OSStatus SecHostSetHostingPort(mach_port_t hostingPort, SecCSFlags flags);
85
86
87 /*
88 Functionality from SecCodeHost.h that is genuinely missing here:
89
90 OSStatus SecHostRemoveGuest(SecGuestRef host, SecGuestRef guest, SecCSFlags flags);
91
92 OSStatus SecHostSelectGuest(SecGuestRef guestRef, SecCSFlags flags);
93
94 OSStatus SecHostSelectedGuest(SecCSFlags flags, SecGuestRef *guestRef);
95
96 */
97
98
99 #ifdef __cplusplus
100 }
101 #endif
102
103 #endif //_H_SECCODEHOSTLIB