File: key_control.h

package info (click to toggle)
android-platform-system-extras 7.0.0%2Br33-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,136 kB
  • sloc: cpp: 28,180; ansic: 14,543; python: 5,376; sh: 2,441; java: 908; asm: 299; makefile: 19; xml: 12
file content (31 lines) | stat: -rw-r--r-- 1,151 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <sys/cdefs.h>
#include <sys/types.h>

__BEGIN_DECLS

// ext4enc:TODO - get these keyring standard definitions from proper system file
// keyring serial number type
typedef int32_t key_serial_t;

// special process keyring shortcut IDs
#define KEY_SPEC_THREAD_KEYRING       -1 // key ID for thread-specific keyring
#define KEY_SPEC_PROCESS_KEYRING      -2 // key ID for process-specific keyring
#define KEY_SPEC_SESSION_KEYRING      -3 // key ID for session-specific keyring
#define KEY_SPEC_USER_KEYRING         -4 // key ID for UID-specific keyring
#define KEY_SPEC_USER_SESSION_KEYRING -5 // key ID for UID-session keyring
#define KEY_SPEC_GROUP_KEYRING        -6 // key ID for GID-specific keyring

key_serial_t add_key(const char *type,
                     const char *description,
                     const void *payload,
                     size_t plen,
                     key_serial_t ringid);

long keyctl_revoke(key_serial_t id);

long keyctl_setperm(key_serial_t id, int permissions);

long keyctl_search(key_serial_t ringid, const char *type,
                   const char *description, key_serial_t destringid);

__END_DECLS