1/* Copyright (c) 2012 Apple Inc. All rights reserved. */
2
3#ifndef _SECURITY_AUTH_PROCESS_H_
4#define _SECURITY_AUTH_PROCESS_H_
5
6#include <CoreFoundation/CoreFoundation.h>
7#include <Security/SecCode.h>
8#include <mach/mach.h>
9
10#if defined(__cplusplus)
11extern "C" {
12#endif
13
14AUTH_WARN_RESULT AUTH_MALLOC AUTH_NONNULL_ALL AUTH_RETURNS_RETAINED
15process_t process_create(const audit_info_s*,session_t);
16
17AUTH_NONNULL_ALL
18const void * process_get_key(process_t);
19
20AUTH_NONNULL_ALL
21uid_t process_get_uid(process_t);
22
23AUTH_NONNULL_ALL
24pid_t process_get_pid(process_t);
25
26AUTH_NONNULL_ALL
27int32_t process_get_generation(process_t);
28
29AUTH_NONNULL_ALL
30session_id_t process_get_session_id(process_t);
31
32AUTH_NONNULL_ALL
33session_t process_get_session(process_t);
34
35AUTH_NONNULL_ALL
36uint32_t process_get_count(process_t);
37
38AUTH_NONNULL_ALL
39const audit_info_s * process_get_audit_info(process_t);
40
41AUTH_NONNULL_ALL
42SecCodeRef process_get_code(process_t);
43
44AUTH_NONNULL_ALL
45const char * process_get_code_url(process_t);
46
47AUTH_NONNULL_ALL
48CFIndex process_add_connection(process_t, connection_t);
49
50AUTH_NONNULL_ALL
51CFIndex process_remove_connection(process_t, connection_t);
52
53AUTH_NONNULL_ALL
54CFIndex process_get_connection_count(process_t);
55
56AUTH_NONNULL_ALL
57void process_add_auth_token(process_t,auth_token_t);
58
59AUTH_NONNULL_ALL
60void process_remove_auth_token(process_t,auth_token_t, uint32_t flags);
61
62AUTH_NONNULL_ALL
63auth_token_t process_find_copy_auth_token(process_t,const AuthorizationBlob*);
64
65AUTH_NONNULL_ALL
66CFIndex process_get_auth_token_count(process_t);
67
68AUTH_NONNULL_ALL
69CFTypeRef process_copy_entitlement_value(process_t, const char * entitlement);
70
71AUTH_NONNULL_ALL
72bool process_has_entitlement(process_t, const char * entitlement);
73
74AUTH_NONNULL_ALL
75bool process_has_entitlement_for_right(process_t, const char * right);
76
77AUTH_NONNULL_ALL
78const char * process_get_identifier(process_t);
79
80AUTH_NONNULL_ALL
81CFDataRef process_get_requirement_data(process_t);
82
83AUTH_NONNULL_ALL
84SecRequirementRef process_get_requirement(process_t);
85
86AUTH_NONNULL_ALL
87bool process_verify_requirment(process_t,SecRequirementRef);
88
89AUTH_NONNULL_ALL
90bool process_apple_signed(process_t proc);
91
92AUTH_NONNULL_ALL
93mach_port_t process_get_bootstrap(process_t);
94
95AUTH_NONNULL_ALL
96bool process_set_bootstrap(process_t, mach_port_t);
97
98#if defined(__cplusplus)
99}
100#endif
101
102#endif /* !_SECURITY_AUTH_PROCESS_H_ */
103