KEYCTL_DESCRIBE


Returns a summary of the key's attributes (but not its payload data) as a string.

Arguments

ecx Key serial number. It may be one of the following special values:

KEY_SPEC_THREAD_KEYRING Caller's thread-specific keyring.
KEY_SPEC_PROCESS_KEYRING Caller's process-specific keyring.
KEY_SPEC_SESSION_KEYRING Caller's session-specific keyring.
KEY_SPEC_USER_KEYRING Caller's UID-specific keyring.
KEY_SPEC_USER_SESSION_KEYRING Caller's UID-session keyring.
KEY_SPEC_GROUP_KEYRING Caller's GID-specific keyring.
KEY_SPEC_REQKEY_AUTH_KEY This specifies the authorization key created by request_key() and passed to the process it spawns to generate a key. If a valid keyring ID is passed in, then this will simply be returned if the key exists; an error will be issued if it doesn't exist.
edx Pointer to a buffer which will receive the return information. The return string has the following format:

<type>;<uid>;<gid>;<perm>;<description>

Where type and description are strings, uid and gid are decimal, and perm is hexadecimal. A NULL character is included at the end of the string if the buffer is sufficiently big.
esi Size of the buffer specified by edx. If the buffer is too small, the full size of the description 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 key specified has expired.
-EKEYREVOKED The key specified had been revoked.
-EACCES The key exists, but is not viewable by the calling process.

Remarks

A process must have view permission on the key for this function to be successful.