1 .\" Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
2 .\" Written by David Howells (dhowells@redhat.com)
4 .\" %%%LICENSE_START(GPLv2+_SW_ONEPARA)
5 .\" This program is free software; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License
7 .\" as published by the Free Software Foundation; either version
8 .\" 2 of the License, or (at your option) any later version.
11 .\" FIXME Document KEYCTL_REJECT (new in 2.6.39)
12 .\" commit fdd1b94581782a2ddf9124414e5b7a5f48ce2f9c
13 .\" Author: David Howells <dhowells@redhat.com>
14 .\" Documentation/security/keys.txt
15 .\" FIXME Document KEYCTL_INSTANTIATE_IOV (new in 2.6.39)
16 .\" commit ee009e4a0d4555ed522a631bae9896399674f064
17 .\" Author: David Howells <dhowells@redhat.com>
18 .\" Documentation/security/keys.txt
19 .\" FIXME Document KEYCTL_INVALIDATE (new in 3.5)
20 .\" commit fd75815f727f157a05f4c96b5294a4617c0557da
21 .\" Author: David Howells <dhowells@redhat.com>
22 .\" Documentation/security/keys.txt
23 .\" FIXME Document KEYCTL_GET_PERSISTENT (new in 3.13)
24 .\" commit f36f8c75ae2e7d4da34f4c908cebdb4aa42c977e
25 .\" Author: David Howells <dhowells@redhat.com>
27 .TH KEYCTL 2 2014-01-22 Linux "Linux Key Management Calls"
29 keyctl \- manipulate the kernel's key management facility
32 .B #include <keyutils.h>
34 .BI "long keyctl(int " cmd ", ...);"
38 has a number of functions available:
40 .B KEYCTL_GET_KEYRING_ID
41 Ask for a keyring's ID.
43 .B KEYCTL_JOIN_SESSION_KEYRING
44 Join or start named session keyring.
53 Set ownership of a key.
62 Clear contents of a keyring.
65 Link a key into a keyring.
68 Unlink a key from a keyring.
71 Search for a key in a keyring.
74 Read a key or keyring's contents.
77 Instantiate a partially constructed key.
80 Negate a partially constructed key.
82 .B KEYCTL_SET_REQKEY_KEYRING
83 Set default request-key keyring.
88 .B KEYCTL_ASSUME_AUTHORITY
89 Assume authority to instantiate key.
93 into individual functions to permit compiler the compiler to check types.
96 section at the bottom.
100 returns the serial number of the key it found.
101 On error, the value \-1
102 will be returned and errno will have been set to an appropriate error.
106 A key operation wasn't permitted.
109 The key quota for the caller's user would be exceeded by creating a key or
110 linking it to the keyring.
113 An expired key was found or specified.
116 A rejected key was found or specified.
119 A revoked key was found or specified.
122 No matching key was found or an invalid key was specified.
124 Although this is a Linux system call, it is not present in
126 but can be found rather in
130 should be specified to the linker.
137 .BR keyctl_set_timeout (3),
138 .BR keyctl_chown (3),
139 .BR keyctl_clear (3),
140 .BR keyctl_describe (3),
141 .BR keyctl_describe_alloc (3),
142 .BR keyctl_get_keyring_ID (3),
143 .BR keyctl_instantiate (3),
144 .BR keyctl_join_session_keyring (3),
146 .BR keyctl_negate (3),
147 .BR keyctl_revoke (3),
148 .BR keyctl_search (3),
149 .BR keyctl_setperm (3),
150 .BR keyctl_set_reqkey_keyring (3),
151 .BR keyctl_set_timeout (3),
153 .BR keyctl_read_alloc (3),
154 .BR keyctl_unlink (3),
155 .BR keyctl_update (3),
158 The kernel source file
159 .IR Documentation/security/keys.txt .