OSDN Git Service

(split) LDP: Update original to LDP v3.38.
[linuxjm/LDP_man-pages.git] / original / man2 / keyctl.2
1 .\"
2 .\" Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
3 .\" Written by David Howells (dhowells@redhat.com)
4 .\"
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.
9 .\"
10 .TH KEYCTL 2 2010-02-25 Linux "Linux Key Management Calls"
11 .SH NAME
12 keyctl \- Manipulate the kernel's key management facility
13 .SH SYNOPSIS
14 .nf
15 .B #include <keyutils.h>
16 .sp
17 .BI "long keyctl(int " cmd ", ...);"
18 .fi
19 .SH DESCRIPTION
20 .BR keyctl ()
21 has a number of functions available:
22 .TP
23 .B KEYCTL_GET_KEYRING_ID
24 Ask for a keyring's ID.
25 .TP
26 .B KEYCTL_JOIN_SESSION_KEYRING
27 Join or start named session keyring.
28 .TP
29 .B KEYCTL_UPDATE
30 Update a key.
31 .TP
32 .B KEYCTL_REVOKE
33 Revoke a key.
34 .TP
35 .B KEYCTL_CHOWN
36 Set ownership of a key.
37 .TP
38 .B KEYCTL_SETPERM
39 Set perms on a key.
40 .TP
41 .B KEYCTL_DESCRIBE
42 Describe a key.
43 .TP
44 .B KEYCTL_CLEAR
45 Clear contents of a keyring.
46 .TP
47 .B KEYCTL_LINK
48 Link a key into a keyring.
49 .TP
50 .B KEYCTL_UNLINK
51 Unlink a key from a keyring.
52 .TP
53 .B KEYCTL_SEARCH
54 Search for a key in a keyring.
55 .TP
56 .B KEYCTL_READ
57 Read a key or keyring's contents.
58 .TP
59 .B KEYCTL_INSTANTIATE
60 Instantiate a partially constructed key.
61 .TP
62 .B KEYCTL_NEGATE
63 Negate a partially constructed key.
64 .TP
65 .B KEYCTL_SET_REQKEY_KEYRING
66 Set default request-key keyring.
67 .TP
68 .B KEYCTL_SET_TIMEOUT
69 Set timeout on a key.
70 .TP
71 .B KEYCTL_ASSUME_AUTHORITY
72 Assume authority to instantiate key.
73 .P
74 These are wrapped by
75 .B libkeyutils
76 into individual functions to permit compiler the compiler to check types.
77 See the
78 .B See Also
79 section at the bottom.
80 .SH RETURN VALUE
81 On success
82 .BR keyctl ()
83 returns the serial number of the key it found.
84 On error, the value
85 .B -1
86 will be returned and errno will have been set to an appropriate error.
87 .SH ERRORS
88 .TP
89 .B EACCES
90 A key operation wasn't permitted.
91 .TP
92 .B EDQUOT
93 The key quota for the caller's user would be exceeded by creating a key or
94 linking it to the keyring.
95 .TP
96 .B EKEYEXPIRED
97 An expired key was found or specified.
98 .TP
99 .B EKEYREJECTED
100 A rejected key was found or specified.
101 .TP
102 .B EKEYREVOKED
103 A revoked key was found or specified.
104 .TP
105 .B ENOKEY
106 No matching key was found or an invalid key was specified.
107 .SH LINKING
108 Although this is a Linux system call, it is not present in
109 .I libc
110 but can be found rather in
111 .IR libkeyutils .
112 When linking,
113 .B -lkeyutils
114 should be specified to the linker.
115 .SH SEE ALSO
116 .BR keyctl (1),
117 .br
118 .BR add_key (2),
119 .br
120 .BR request_key (2),
121 .br
122 .BR keyctl_get_keyring_ID (3),
123 .br
124 .BR keyctl_join_session_keyring (3),
125 .br
126 .BR keyctl_update (3),
127 .br
128 .BR keyctl_revoke (3),
129 .br
130 .BR keyctl_chown (3),
131 .br
132 .BR keyctl_setperm (3),
133 .br
134 .BR keyctl_describe (3),
135 .br
136 .BR keyctl_clear (3),
137 .br
138 .BR keyctl_link (3),
139 .br
140 .BR keyctl_unlink (3),
141 .br
142 .BR keyctl_search (3),
143 .br
144 .BR keyctl_read (3),
145 .br
146 .BR keyctl_instantiate (3),
147 .br
148 .BR keyctl_negate (3),
149 .br
150 .BR keyctl_set_reqkey_keyring (3),
151 .br
152 .BR keyctl_set_timeout (3),
153 .br
154 .BR keyctl_assume_authority (3),
155 .br
156 .BR keyctl_describe_alloc (3),
157 .br
158 .BR keyctl_read_alloc (3),
159 .br
160 .BR request-key (8)