KEYCTL(2) Linux Key Management Calls KEYCTL(2)NAME
keyctl - manipulate the kernel's key management facility
long keyctl(int cmd, ...);
DESCRIPTIONkeyctl() has a number of functions available:
Ask for a keyring's ID.
Join or start named session keyring.
Update a key.
Revoke a key.
Set ownership of a key.
Set perms on a key.
Describe a key.
Clear contents of a keyring.
Link a key into a keyring.
Unlink a key from a keyring.
Search for a key in a keyring.
Read a key or keyring's contents.
Instantiate a partially constructed key.
Negate a partially constructed key.
Set default request-key keyring.
Set timeout on a key.
Assume authority to instantiate key.
These are wrapped by libkeyutils into individual functions to permit
compiler the compiler to check types. See the See Also section at the
On success keyctl() returns the serial number of the key it found. On
error, the value -1 will be returned and errno will have been set to an
EACCES A key operation wasn't permitted.
EDQUOT The key quota for the caller's user would be exceeded by creat‐
ing a key or linking it to the keyring.
An expired key was found or specified.
A rejected key was found or specified.
A revoked key was found or specified.
ENOKEY No matching key was found or an invalid key was specified.
Although this is a Linux system call, it is not present in libc but can
be found rather in libkeyutils. When linking, -lkeyutils should be
specified to the linker.
SEE ALSOkeyctl(1), add_key(2), request_key(2), keyctl_set_timeout(3),
keyctl_chown(3), keyctl_clear(3), keyctl_describe(3),
keyctl_instantiate(3), keyctl_join_session_keyring(3), keyctl_link(3),
keyctl_negate(3), keyctl_revoke(3), keyctl_search(3),
keyctl_setperm(3), keyctl_set_reqkey_keyring(3), keyctl_set_timeout(3),
keyctl_read(3), keyctl_read_alloc(3), keyctl_unlink(3),
The kernel source file Documentation/security/keys.txt.
This page is part of release 3.65 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2014-01-22 KEYCTL(2)