2  * Copyright (c) 2006,2011-2012,2014 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         SecStaticCodePriv is the private counter-part to SecStaticCode. Its contents are not 
  27         official API, and are subject to change without notice. 
  29 #ifndef _H_SECSTATICCODEPRIV 
  30 #define _H_SECSTATICCODEPRIV 
  32 #include <Security/SecStaticCode.h> 
  40         @function SecCodeSetCallback 
  41         For a given Code or StaticCode object, specify a block that is invoked at certain 
  42         stages of a validation operation. The block is only invoked for validations of this 
  43         particular object. Note that validation outcomes are cached in the API object, and 
  44         repeated validations will not generally result in the same set of callbacks. 
  45         Only one callback can be active for each API object. A new call to SecCodeSetCallback 
  46         replaces the previous callback. 
  48         @param code A Code or StaticCode object whose validation should be monitored. 
  49         @param flags Optional flags. Pass kSecCSDefaultFlags for standard behavior. 
  50         @param old A pointer to a block pointer that receives any previously registered callback. 
  51                 Pass NULL if you are not interested in any previous value. 
  52         @param callback A block to be synchronously invoked at certain stages of API operation. 
  53                 Pass NULL to disable callbacks for this code object. The block must be available to 
  54                 be invoked, possibly repeatedly, for as long as the code object exists or it is superseded 
  55                 by another call to this API, whichever happens earlier. 
  56                 From your block, return NULL to continue normal operation. Return a CFTypeRef object of 
  57                 suitable value for the reported stage to intervene. 
  59 OSStatus 
SecStaticCodeSetCallback(SecStaticCodeRef code
, SecCSFlags flag
, SecCodeCallback 
*olds
, SecCodeCallback callback
); 
  63         @function SecStaticCodeSetValidationConditions 
  64         Set various parameters that modify the evaluation of a signature. 
  65         This is an internal affordance used by Gatekeeper to implement checkfix evaluation. 
  66         It is not meant to be a generally useful mechanism. 
  68         @param code A Code or StaticCode object whose validation should be modified. 
  69         @param conditions A dictionary containing one or more validation conditions. Must not be NULL. 
  71 OSStatus 
SecStaticCodeSetValidationConditions(SecStaticCodeRef code
, CFDictionaryRef conditions
); 
  75         @function SecStaticCodeCancelValidation 
  76         Ask for an ongoing static validation using this (static) code object to be canceled as soon as feasible. 
  77         if no validation is pending, this does nothing. 
  78         Since validation is synchronous, this call must be made from another thread. 
  79         This call will return immediately. If a validation operation is terminated due to it, 
  80         it will fail with the errSecCSVetoed error. 
  82         @param code A Code or StaticCode object whose validation should be modified. 
  83         @param flags Optional flags. Pass kSecCSDefaultFlags for standard behavior. 
  85 OSStatus 
SecStaticCodeCancelValidation(SecStaticCodeRef code
, SecCSFlags flags
); 
  92 #endif //_H_SECSTATICCODEPRIV