]>
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> 
  40 #include "SecCodeHost.h" 
  41 #include <System/sys/codesign.h> 
  49         @function SecHostLibInit 
  50         This function must be called first to use the SecCodeHostLib facility. 
  52 OSStatus 
SecHostLibInit(SecCSFlags flags
); 
  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. 
  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. 
  63 OSStatus 
SecHostLibCreateGuest(SecGuestRef host
, 
  64         uint32_t status
, const char *path
, const char *attributeXML
, 
  65         SecCSFlags flags
, SecGuestRef 
*newGuest
); 
  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. 
  73 OSStatus 
SecHostLibSetGuestStatus(SecGuestRef guestRef
, 
  74         uint32_t status
, const char *attributeXML
, 
  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. 
  84 OSStatus 
SecHostSetHostingPort(mach_port_t hostingPort
, SecCSFlags flags
); 
  88         Functionality from SecCodeHost.h that is genuinely missing here: 
  90 OSStatus SecHostRemoveGuest(SecGuestRef host, SecGuestRef guest, SecCSFlags flags); 
  92 OSStatus SecHostSelectGuest(SecGuestRef guestRef, SecCSFlags flags); 
  94 OSStatus SecHostSelectedGuest(SecCSFlags flags, SecGuestRef *guestRef); 
 103 #endif //_H_SECCODEHOSTLIB