]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_keychain/lib/SecTrustedApplication.h
Security-57337.50.23.tar.gz
[apple/security.git] / OSX / libsecurity_keychain / lib / SecTrustedApplication.h
1 /*
2 * Copyright (c) 2002-2004,2011-2012,2014 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 SecTrustedApplication
26 The functions provided in SecTrustedApplication implement an object representing an application in a
27 SecAccess object.
28 */
29
30 #ifndef _SECURITY_SECTRUSTEDAPPLICATION_H_
31 #define _SECURITY_SECTRUSTEDAPPLICATION_H_
32
33 #include <Security/SecBase.h>
34 #include <CoreFoundation/CoreFoundation.h>
35
36
37 #if defined(__cplusplus)
38 extern "C" {
39 #endif
40
41 CF_ASSUME_NONNULL_BEGIN
42
43 /*!
44 @function SecTrustedApplicationGetTypeID
45 @abstract Returns the type identifier of SecTrustedApplication instances.
46 @result The CFTypeID of SecTrustedApplication instances.
47 */
48 CFTypeID SecTrustedApplicationGetTypeID(void);
49
50 /*!
51 @function SecTrustedApplicationCreateFromPath
52 @abstract Creates a trusted application reference based on the trusted application specified by path.
53 @param path The path to the application or tool to trust. For application bundles, use the
54 path to the bundle directory. Pass NULL to refer to yourself, i.e. the application or tool
55 making this call.
56 @param app On return, a pointer to the trusted application reference.
57 @result A result code. See "Security Error Codes" (SecBase.h).
58 */
59 OSStatus SecTrustedApplicationCreateFromPath(const char * __nullable path, SecTrustedApplicationRef * __nonnull CF_RETURNS_RETAINED app);
60
61 /*!
62 @function SecTrustedApplicationCopyData
63 @abstract Retrieves the data of a given trusted application reference
64 @param appRef A trusted application reference to retrieve data from
65 @param data On return, a pointer to a data reference of the trusted application.
66 @result A result code. See "Security Error Codes" (SecBase.h).
67 */
68 OSStatus SecTrustedApplicationCopyData(SecTrustedApplicationRef appRef, CFDataRef * __nonnull CF_RETURNS_RETAINED data);
69
70 /*!
71 @function SecTrustedApplicationSetData
72 @abstract Sets the data of a given trusted application reference
73 @param appRef A trusted application reference.
74 @param data A reference to the data to set in the trusted application.
75 @result A result code. See "Security Error Codes" (SecBase.h).
76 */
77 OSStatus SecTrustedApplicationSetData(SecTrustedApplicationRef appRef, CFDataRef data);
78
79 CF_ASSUME_NONNULL_END
80
81 #if defined(__cplusplus)
82 }
83 #endif
84
85 #endif /* !_SECURITY_SECTRUSTEDAPPLICATION_H_ */