2
.\" Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
3
.\" Written by David Howells (dhowells@redhat.com)
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.
10
.TH KEYCTL_DESCRIBE 3 "4 May 2006" Linux "Linux Key Management Calls"
11
.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
13
keyctl_describe \- Describe a key
14
.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
17
.B #include <keyutils.h>
19
.BI "long keyctl_describe(key_serial_t " key ", char *" buffer ,
20
.BI "size_t" buflen ");"
22
.BI "long keyctl_describe_alloc(key_serial_t " key ", char **" _buffer ");"
23
.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
25
.BR keyctl_describe ()
26
describes the attributes of a key as a NUL-terminated string.
30
permission on a key to be able to get a description of it.
35
specify the buffer into which the key description will be placed. If the
36
buffer is too small, the full size of the description will be returned, and no
39
.BR keyctl_describe_alloc ()
41
.BR keyctl_describe ()
42
except that it allocates a buffer big enough to hold the description and
43
places the description in it. If successful, A pointer to the buffer is
46
The caller must free the buffer.
48
The description will be a string of format:
50
.B "\*(lq%s;%d;%d;%08x;%s\*(rq"
52
where the arguments are: key type name, key UID, key GID, key permissions mask
56
The key description will not contain any semicolons, so that should be
57
separated out by working backwards from the end of the string. This permits
58
extra information to be inserted before it by later versions of the kernel
59
simply by inserting more semicolon-terminated substrings.
60
.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
63
.BR keyctl_describe ()
64
returns the amount of data placed into the buffer. If the buffer was too
65
small, then the size of buffer required will be returned, but no data will be
66
transferred. On error, the value
68
will be returned and errno will have been set to an appropriate error.
71
.BR keyctl_describe_alloc ()
72
returns the amount of data in the buffer, less the NUL terminator. On error, the value
74
will be returned and errno will have been set to an appropriate error.
75
.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
79
The key specified is invalid.
82
The key specified has expired.
85
The key specified had been revoked.
88
The key exists, but is not
90
by the calling process.
91
.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
93
This is a library function that can be found in
97
should be specified to the linker.
98
.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""