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)
7extern "C" {
8#endif
9
10#ifdef __BLOCKS__
11    typedef bool (^credential_iterator_t)(credential_t);
12#endif /* __BLOCKS__ */
13
14AUTH_WARN_RESULT AUTH_MALLOC AUTH_NONNULL_ALL AUTH_RETURNS_RETAINED
15credential_t credential_create(uid_t);
16
17AUTH_WARN_RESULT AUTH_MALLOC AUTH_NONNULL_ALL AUTH_RETURNS_RETAINED
18credential_t credential_create_with_credential(credential_t,bool);
19
20AUTH_WARN_RESULT AUTH_MALLOC AUTH_NONNULL_ALL AUTH_RETURNS_RETAINED
21credential_t credential_create_with_right(const char *);
22
23AUTH_NONNULL_ALL
24uid_t credential_get_uid(credential_t);
25
26AUTH_NONNULL_ALL
27const char * credential_get_name(credential_t);
28
29AUTH_NONNULL_ALL
30const char * credential_get_realname(credential_t);
31
32AUTH_NONNULL_ALL
33CFAbsoluteTime credential_get_creation_time(credential_t);
34
35AUTH_NONNULL_ALL
36bool credential_get_valid(credential_t);
37
38AUTH_NONNULL_ALL
39bool credential_get_shared(credential_t);
40
41AUTH_NONNULL_ALL
42bool credential_is_right(credential_t);
43
44AUTH_NONNULL_ALL
45bool credential_check_membership(credential_t,const char*);
46
47AUTH_NONNULL_ALL
48void credential_invalidate(credential_t);
49
50#if defined(__cplusplus)
51}
52#endif
53
54#endif /* !_SECURITY_AUTH_CREDENTIAL_H_ */
55