OSDN Git Service

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