KEYCTL_READ


Reads the payload data from the specified key into the buffer.

Arguments

ecx Key serial number.
edx Pointer to a buffer which will receive the payload data. The data is presented to the user as an array of key_serial_t values, each of which corresponds to a key to which the keyring holds a link. The size of the keyring will be sizeof.key_serial_t multiplied by the number of keys.
esi Size of the buffer pointed by edx. If the buffer is too small, the full size of the payload will be returned, and no copy will take place.

Return values

If the system call succeeds the return value is the amount of data placed into the buffer. If the buffer was too small, then the size of buffer required will be returned, but no data will be transferred.
If the system call fails the return value is one of the following errno values:

-ENOKEY No matching key was found.
-EKEYEXPIRED The keyring specified has expired.
-EKEYREVOKED The keyring specified had been revoked.
-EACCES The key exists, but is not readable by the calling process.
-EOPNOTSUPP The key type does not support reading of the payload data.

Remarks

The caller must have read permission on a key to be able to read it.