]> git.saurik.com Git - apple/security.git/blob - OSX/authd/authtoken.h
Security-59306.11.20.tar.gz
[apple/security.git] / OSX / authd / authtoken.h
1 /* Copyright (c) 2012-2013 Apple Inc. All Rights Reserved. */
2
3 #ifndef _SECURITY_AUTH_AUTHTOKEN_H_
4 #define _SECURITY_AUTH_AUTHTOKEN_H_
5
6 #include "credential.h"
7 #include <CoreFoundation/CoreFoundation.h>
8
9 #if defined(__cplusplus)
10 extern "C" {
11 #endif
12
13 enum {
14 auth_token_state_zombie = 1 << 0,
15 auth_token_state_registered = 1 << 1
16 };
17 typedef uint32_t auth_token_state_t;
18
19 extern const CFDictionaryKeyCallBacks kAuthTokenKeyCallBacks;
20
21 AUTH_WARN_RESULT AUTH_MALLOC AUTH_NONNULL_ALL AUTH_RETURNS_RETAINED
22 auth_token_t auth_token_create(process_t,bool operateAsLeastPrivileged);
23
24 AUTH_NONNULL_ALL
25 bool auth_token_get_sandboxed(auth_token_t);
26
27 AUTH_NONNULL_ALL
28 const char * auth_token_get_code_url(auth_token_t);
29
30 AUTH_NONNULL_ALL
31 const void * auth_token_get_key(auth_token_t);
32
33 AUTH_NONNULL_ALL
34 auth_items_t auth_token_get_context(auth_token_t);
35
36 AUTH_NONNULL_ALL
37 bool auth_token_least_privileged(auth_token_t);
38
39 AUTH_NONNULL_ALL
40 uid_t auth_token_get_uid(auth_token_t);
41
42 AUTH_NONNULL_ALL
43 pid_t auth_token_get_pid(auth_token_t);
44
45 AUTH_NONNULL_ALL
46 session_t auth_token_get_session(auth_token_t);
47
48 AUTH_NONNULL_ALL
49 const AuthorizationBlob * auth_token_get_blob(auth_token_t);
50
51 AUTH_NONNULL_ALL
52 const audit_info_s * auth_token_get_audit_info(auth_token_t);
53
54 AUTH_NONNULL_ALL
55 mach_port_t auth_token_get_creator_bootstrap(auth_token_t auth);
56
57 AUTH_NONNULL_ALL
58 CFIndex auth_token_add_process(auth_token_t,process_t);
59
60 AUTH_NONNULL_ALL
61 CFIndex auth_token_remove_process(auth_token_t,process_t);
62
63 AUTH_NONNULL_ALL
64 CFIndex auth_token_get_process_count(auth_token_t);
65
66 AUTH_NONNULL_ALL
67 void auth_token_set_credential(auth_token_t,credential_t);
68
69 AUTH_NONNULL_ALL
70 bool auth_token_credentials_iterate(auth_token_t, credential_iterator_t iter);
71
72 AUTH_NONNULL_ALL
73 void auth_token_set_right(auth_token_t,credential_t);
74
75 AUTH_NONNULL_ALL
76 CFTypeRef auth_token_copy_entitlement_value(auth_token_t, const char * entitlement);
77
78 AUTH_NONNULL_ALL
79 bool auth_token_has_entitlement(auth_token_t, const char * entitlement);
80
81 AUTH_NONNULL_ALL
82 bool auth_token_has_entitlement_for_right(auth_token_t, const char * right);
83
84 AUTH_NONNULL_ALL
85 credential_t auth_token_get_credential(auth_token_t);
86
87 AUTH_NONNULL_ALL
88 bool auth_token_apple_signed(auth_token_t);
89
90 AUTH_NONNULL_ALL
91 bool auth_token_is_creator(auth_token_t,process_t);
92
93 AUTH_NONNULL_ALL
94 void auth_token_set_state(auth_token_t,auth_token_state_t);
95
96 AUTH_NONNULL_ALL
97 void auth_token_clear_state(auth_token_t,auth_token_state_t);
98
99 AUTH_WARN_RESULT AUTH_NONNULL_ALL
100 auth_token_state_t auth_token_get_state(auth_token_t);
101
102 AUTH_NONNULL_ALL
103 bool auth_token_check_state(auth_token_t, auth_token_state_t);
104
105 AUTH_NONNULL_ALL
106 CFDataRef auth_token_get_encryption_key(auth_token_t auth);
107
108 #if defined(__cplusplus)
109 }
110 #endif
111
112 #endif /* !_SECURITY_AUTH_AUTHTOKEN_H_ */