File: keyctl.2

package info (click to toggle)
manpages 3.27-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 12,228 kB
  • ctags: 9
  • sloc: sh: 389; perl: 164; makefile: 77; lisp: 22
file content (167 lines) | stat: -rw-r--r-- 3,401 bytes parent folder | download | duplicates (2)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
.\"
.\" Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
.\" Written by David Howells (dhowells@redhat.com)
.\"
.\" This program is free software; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License
.\" as published by the Free Software Foundation; either version
.\" 2 of the License, or (at your option) any later version.
.\"
.TH KEYCTL 2 2010-02-25 Linux "Linux Key Management Calls"
.SH NAME
keyctl \- Manipulate the kernel's key management facility
.SH SYNOPSIS
.nf
.B #include <keyutils.h>
.sp
.BI "long keyctl(int " cmd ", ...);"
.SH DESCRIPTION
.BR keyctl ()
has a number of functions available:
.TP
.B KEYCTL_GET_KEYRING_ID	
Ask for a keyring's ID.
.TP
.B KEYCTL_JOIN_SESSION_KEYRING	
Join or start named session keyring.
.TP
.B KEYCTL_UPDATE			
Update a key.
.TP
.B KEYCTL_REVOKE			
Revoke a key.
.TP
.B KEYCTL_CHOWN			
Set ownership of a key.
.TP
.B KEYCTL_SETPERM			
Set perms on a key.
.TP
.B KEYCTL_DESCRIBE			
Describe a key.
.TP
.B KEYCTL_CLEAR			
Clear contents of a keyring.
.TP
.B KEYCTL_LINK			
Link a key into a keyring.
.TP
.B KEYCTL_UNLINK			
Unlink a key from a keyring.
.TP
.B KEYCTL_SEARCH			
Search for a key in a keyring.
.TP
.B KEYCTL_READ			
Read a key or keyring's contents.
.TP
.B KEYCTL_INSTANTIATE		
Instantiate a partially constructed key.
.TP
.B KEYCTL_NEGATE			
Negate a partially constructed key.
.TP
.B KEYCTL_SET_REQKEY_KEYRING	
Set default request-key keyring.
.TP
.B KEYCTL_SET_TIMEOUT		
Set timeout on a key.
.TP
.B KEYCTL_ASSUME_AUTHORITY		
Assume authority to instantiate key.
.P
These are wrapped by
.B libkeyutils
into individual functions to permit compiler the compiler to check types.
See the
.B See Also
section at the bottom.
.SH RETURN VALUE
On success
.BR keyctl ()
returns the serial number of the key it found.
On error, the value
.B -1
will be returned and errno will have been set to an appropriate error.
.SH ERRORS
.TP
.B ENOKEY
No matching key was found or an invalid key was specified.
.TP
.B EKEYEXPIRED
An expired key was found or specified.
.TP
.B EKEYREVOKED
A revoked key was found or specified.
.TP
.B EKEYREJECTED
A rejected key was found or specified.
.TP
.B EDQUOT
The key quota for the caller's user would be exceeded by creating a key or
linking it to the keyring.
.TP
.B EACCES
A key operation wasn't permitted.
.SH LINKING
Although this is a Linux system call, it is not present in
.I libc
but can be found rather in
.IR libkeyutils .
When linking,
.B -lkeyutils
should be specified to the linker.
.SH SEE ALSO
.BR keyctl (1),
.br
.BR add_key (2),
.br
.BR request_key (2),
.br
.BR keyctl_get_keyring_ID (3),
.br
.BR keyctl_join_session_keyring (3),
.br
.BR keyctl_update (3),
.br
.BR keyctl_revoke (3),
.br
.BR keyctl_chown (3),
.br
.BR keyctl_setperm (3),
.br
.BR keyctl_describe (3),
.br
.BR keyctl_clear (3),
.br
.BR keyctl_link (3),
.br
.BR keyctl_unlink (3),
.br
.BR keyctl_search (3),
.br
.BR keyctl_read (3),
.br
.BR keyctl_instantiate (3),
.br
.BR keyctl_negate (3),
.br
.BR keyctl_set_reqkey_keyring (3),
.br
.BR keyctl_set_timeout (3),
.br
.BR keyctl_assume_authority (3),
.br
.BR keyctl_describe_alloc (3),
.br
.BR keyctl_read_alloc (3),
.br
.BR request-key (8)
.SH COLOPHON
This page is part of release 3.27 of the Linux
.I man-pages
project.
A description of the project,
and information about reporting bugs,
can be found at
http://www.kernel.org/doc/man-pages/.