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>
39 Private SecStaticCodeCreate* SecCS flags.
42 kSecCSForceOnlineNotarizationCheck
= 1 << 0,
47 @function SecCodeSetCallback
48 For a given Code or StaticCode object, specify a block that is invoked at certain
49 stages of a validation operation. The block is only invoked for validations of this
50 particular object. Note that validation outcomes are cached in the API object, and
51 repeated validations will not generally result in the same set of callbacks.
52 Only one callback can be active for each API object. A new call to SecCodeSetCallback
53 replaces the previous callback.
55 @param code A Code or StaticCode object whose validation should be monitored.
56 @param flags Optional flags. Pass kSecCSDefaultFlags for standard behavior.
57 @param old A pointer to a block pointer that receives any previously registered callback.
58 Pass NULL if you are not interested in any previous value.
59 @param callback A block to be synchronously invoked at certain stages of API operation.
60 Pass NULL to disable callbacks for this code object. The block must be available to
61 be invoked, possibly repeatedly, for as long as the code object exists or it is superseded
62 by another call to this API, whichever happens earlier.
63 From your block, return NULL to continue normal operation. Return a CFTypeRef object of
64 suitable value for the reported stage to intervene.
66 OSStatus
SecStaticCodeSetCallback(SecStaticCodeRef code
, SecCSFlags flag
, SecCodeCallback
*olds
, SecCodeCallback callback
);
70 @function SecStaticCodeSetValidationConditions
71 Set various parameters that modify the evaluation of a signature.
72 This is an internal affordance used by Gatekeeper to implement checkfix evaluation.
73 It is not meant to be a generally useful mechanism.
75 @param code A Code or StaticCode object whose validation should be modified.
76 @param conditions A dictionary containing one or more validation conditions. Must not be NULL.
78 OSStatus
SecStaticCodeSetValidationConditions(SecStaticCodeRef code
, CFDictionaryRef conditions
);
82 @function SecStaticCodeCancelValidation
83 Ask for an ongoing static validation using this (static) code object to be canceled as soon as feasible.
84 if no validation is pending, this does nothing.
85 Since validation is synchronous, this call must be made from another thread.
86 This call will return immediately. If a validation operation is terminated due to it,
87 it will fail with the errSecCSVetoed error.
89 @param code A Code or StaticCode object whose validation should be modified.
90 @param flags Optional flags. Pass kSecCSDefaultFlags for standard behavior.
92 OSStatus
SecStaticCodeCancelValidation(SecStaticCodeRef code
, SecCSFlags flags
);
99 #endif //_H_SECSTATICCODEPRIV