]>
git.saurik.com Git - apple/libsecurity_codesigning.git/blob - lib/SecCodeHostLib.h
2 * Copyright (c) 2007 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@
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>.
33 This file is documented as a delta to <Security/SecCodeHost.h>, which
34 you should consult as a baseline.
36 #ifndef _H_SECCODEHOSTLIB
37 #define _H_SECCODEHOSTLIB
39 #include <Security/SecCodeHost.h>
47 @function SecHostLibInit
48 This function must be called first to use the SecCodeHostLib facility.
50 OSStatus
SecHostLibInit(SecCSFlags flags
);
54 @function SecHostLibCreateGuest
55 This function declares a code host, engages hosting proxy services for it,
56 and creates a guest with given attributes and state.
58 NOTE: This version of the function currently only supports dedicated hosting.
59 If you do not pass the kSecCSDedicatedHost flag, the call will fail.
61 OSStatus
SecHostLibCreateGuest(SecGuestRef host
,
62 uint32_t status
, const char *path
, const char *attributeXML
,
63 SecCSFlags flags
, SecGuestRef
*newGuest
) DEPRECATED_ATTRIBUTE
;
65 OSStatus
SecHostLibCreateGuest2(SecGuestRef host
,
66 uint32_t status
, const char *path
, const void *cdhash
, size_t cdhashLength
, const char *attributeXML
,
67 SecCSFlags flags
, SecGuestRef
*newGuest
);
71 @function SecHostLibSetGuestStatus
72 This function can change the state or attributes (or both) of a given guest.
73 It performs all the work of SecHostSetGuestStatus.
75 OSStatus
SecHostLibSetGuestStatus(SecGuestRef guestRef
,
76 uint32_t status
, const char *attributeXML
,
81 @function SecHostLibSetHostingPort
82 Register a Mach port to receive hosting queries on. This enables (and locks)
83 dynamic hosting mode, and is incompatible with all proxy-mode calls.
84 You still must call SecHostLibInit first.
86 OSStatus
SecHostSetHostingPort(mach_port_t hostingPort
, SecCSFlags flags
);
90 Functionality from SecCodeHost.h that is genuinely missing here:
92 OSStatus SecHostRemoveGuest(SecGuestRef host, SecGuestRef guest, SecCSFlags flags);
94 OSStatus SecHostSelectGuest(SecGuestRef guestRef, SecCSFlags flags);
96 OSStatus SecHostSelectedGuest(SecCSFlags flags, SecGuestRef *guestRef);
103 OSStatus
SecHostLibCheckLoad(const char *path
, SecRequirementType type
);
110 #endif //_H_SECCODEHOSTLIB