]> git.saurik.com Git - apple/security.git/blob - Security/authd/credential.h
Security-57031.1.35.tar.gz
[apple/security.git] / Security / authd / credential.h
1 /* Copyright (c) 2012 Apple Inc. All Rights Reserved. */
2
3 #ifndef _SECURITY_AUTH_CREDENTIAL_H_
4 #define _SECURITY_AUTH_CREDENTIAL_H_
5
6 #if defined(__cplusplus)
7 extern "C" {
8 #endif
9
10 #ifdef __BLOCKS__
11 typedef bool (^credential_iterator_t)(credential_t);
12 #endif /* __BLOCKS__ */
13
14 AUTH_WARN_RESULT AUTH_MALLOC AUTH_NONNULL_ALL AUTH_RETURNS_RETAINED
15 credential_t credential_create(uid_t);
16
17 AUTH_WARN_RESULT AUTH_MALLOC AUTH_NONNULL_ALL AUTH_RETURNS_RETAINED
18 credential_t credential_create_with_credential(credential_t,bool);
19
20 AUTH_WARN_RESULT AUTH_MALLOC AUTH_NONNULL_ALL AUTH_RETURNS_RETAINED
21 credential_t credential_create_with_right(const char *);
22
23 AUTH_NONNULL_ALL
24 uid_t credential_get_uid(credential_t);
25
26 AUTH_NONNULL_ALL
27 const char * credential_get_name(credential_t);
28
29 AUTH_NONNULL_ALL
30 const char * credential_get_realname(credential_t);
31
32 AUTH_NONNULL_ALL
33 CFAbsoluteTime credential_get_creation_time(credential_t);
34
35 AUTH_NONNULL_ALL
36 bool credential_get_valid(credential_t);
37
38 AUTH_NONNULL_ALL
39 bool credential_get_shared(credential_t);
40
41 AUTH_NONNULL_ALL
42 bool credential_is_right(credential_t);
43
44 AUTH_NONNULL_ALL
45 bool credential_check_membership(credential_t,const char*);
46
47 AUTH_NONNULL_ALL
48 void credential_invalidate(credential_t);
49
50 #if defined(__cplusplus)
51 }
52 #endif
53
54 #endif /* !_SECURITY_AUTH_CREDENTIAL_H_ */