KEYCTL_REVOKE2const
Revoke a key
Usage
#include <linux/keyctl.h> /* Definition of KEY* constants */ #include <sys/syscall.h> /* Definition of SYS_* constants */ #include <unistd.h>
long syscall(SYS_keyctl, KEYCTL_REVOKE, key_serial_t key);
Library
Standard C library (libc, -lc)
Overview
Revoke the key with the ID provided in key. The key is scheduled for garbage collection; it will no longer be findable, and will be unavailable for further operations. Further attempts to use the key will fail with the error EKEYREVOKED.
The caller must have write or setattr permission on the key.
Return value
On success, 0 is returned.
On error, -1 is returned, and errno is set to indicate the error.
Versions
A wrapper is provided in the libkeyutils library: keyctl_revoke(3).