text
stringlengths
0
234
the size of that buffer must be specified in
.i arg4
(cast to
.ir size_t ).
.ip
the returned data will be processed for presentation
according to the key type.
for example, a keyring will return an array of
.i key_serial_t
entries representing the ids of all the keys that are linked to it.
the
.ir "user"
key type will return its data as is.
if a key type does not implement this function,
the operation fails with the error
.br eopnotsupp .
.ip
if
.i arg3
is not null,
as much of the payload data as will fit is copied into the buffer.
on a successful return,
the return value is always the total size of the payload data.
to determine whether the buffer was of sufficient size,
check to see that the return value is less than or equal to
the value supplied in
.ir arg4 .
.ip
the key must either grant the caller
.i read
permission, or grant the caller
.i search
permission when searched for from the process keyrings
(i.e., the key is possessed).
.ip
the
.i arg5
argument is ignored.
.ip
this operation is exposed by
.i libkeyutils
via the function
.br keyctl_read (3).
.tp
.br keyctl_instantiate " (since linux 2.6.10)"
(positively) instantiate an uninstantiated key with a specified payload.
.ip
the id of the key to be instantiated is provided in
.i arg2
(cast to
.ir key_serial_t ).
.ip
the key payload is specified in the buffer pointed to by
.i arg3
(cast to
.ir "void\ *");
the size of that buffer is specified in
.i arg4
(cast to
.ir size_t ).
.ip
the payload may be a null pointer and the buffer size may be 0
if this is supported by the key type (e.g., it is a keyring).
.ip
the operation may be fail if the payload data is in the wrong format
or is otherwise invalid.
.ip
if
.i arg5
(cast to
.ir key_serial_t )
is nonzero, then, subject to the same constraints and rules as
.br keyctl_link ,
the instantiated key is linked into the keyring whose id specified in
.ir arg5 .
.ip
the caller must have the appropriate authorization key,
and once the uninstantiated key has been instantiated,
the authorization key is revoked.
in other words, this operation is available only from a
.br request\-key (8)-style
program.
see
.br request_key (2)
for an explanation of uninstantiated keys and key instantiation.
.ip
this operation is exposed by
.i libkeyutils
via the function
.br keyctl_instantiate (3).
.tp
.br keyctl_negate " (since linux 2.6.10)"
negatively instantiate an uninstantiated key.
.ip
this operation is equivalent to the call:
.ip
keyctl(keyctl_reject, arg2, arg3, enokey, arg4);
.ip
the
.i arg5