2010-02-25 07:29:42 +00:00
|
|
|
.\"
|
|
|
|
.\" Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
|
|
|
|
.\" Written by David Howells (dhowells@redhat.com)
|
|
|
|
.\"
|
|
|
|
.\" This program is free software; you can redistribute it and/or
|
|
|
|
.\" modify it under the terms of the GNU General Public License
|
|
|
|
.\" as published by the Free Software Foundation; either version
|
|
|
|
.\" 2 of the License, or (at your option) any later version.
|
|
|
|
.\"
|
add_key.2, keyctl.2, request_key.2, stime.2, time.2, ctime.3, difftime.3, ftime.3, getspnam.3, mq_receive.3, mq_send.3, rtime.3, sem_wait.3, string.3, timeradd.3, tzset.3, rtc.4, core.5, icmp.7, time.7, zic.8: Updated .TH timestamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-02-25 09:43:57 +00:00
|
|
|
.TH KEYCTL 2 2010-02-25 Linux "Linux Key Management Calls"
|
2010-02-25 07:29:42 +00:00
|
|
|
.SH NAME
|
|
|
|
keyctl \- Manipulate the kernel's key management facility
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.nf
|
|
|
|
.B #include <keyutils.h>
|
|
|
|
.sp
|
|
|
|
.BI "long keyctl(int " cmd ", ...);"
|
add_key.2, keyctl.2, request_key.2, offsetof.3, pthread_attr_init.3, pthread_attr_setaffinity_np.3, pthread_attr_setdetachstate.3, pthread_attr_setguardsize.3, pthread_attr_setinheritsched.3, pthread_attr_setschedparam.3, pthread_attr_setschedpolicy.3, pthread_attr_setscope.3, pthread_attr_setstackaddr.3, pthread_attr_setstacksize.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_equal.3, pthread_exit.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_self.3, pthread_setaffinity_np.3, pthread_setcancelstate.3, pthread_setconcurrency.3, pthread_setschedparam.3, pthread_setschedprio.3, pthread_testcancel.3: Global formatting fix: balance .nf/.fi pairs
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-03-12 15:37:22 +00:00
|
|
|
.fi
|
2010-02-25 07:29:42 +00:00
|
|
|
.SH DESCRIPTION
|
|
|
|
.BR keyctl ()
|
|
|
|
has a number of functions available:
|
|
|
|
.TP
|
2012-03-20 17:24:41 +00:00
|
|
|
.B KEYCTL_GET_KEYRING_ID
|
2010-02-25 07:29:42 +00:00
|
|
|
Ask for a keyring's ID.
|
|
|
|
.TP
|
2012-03-20 17:24:41 +00:00
|
|
|
.B KEYCTL_JOIN_SESSION_KEYRING
|
2010-02-25 07:29:42 +00:00
|
|
|
Join or start named session keyring.
|
|
|
|
.TP
|
2012-03-20 17:24:41 +00:00
|
|
|
.B KEYCTL_UPDATE
|
2010-02-25 07:29:42 +00:00
|
|
|
Update a key.
|
|
|
|
.TP
|
2012-03-20 17:24:41 +00:00
|
|
|
.B KEYCTL_REVOKE
|
2010-02-25 07:29:42 +00:00
|
|
|
Revoke a key.
|
|
|
|
.TP
|
2012-03-20 17:24:41 +00:00
|
|
|
.B KEYCTL_CHOWN
|
2010-02-25 07:29:42 +00:00
|
|
|
Set ownership of a key.
|
|
|
|
.TP
|
2012-03-20 17:24:41 +00:00
|
|
|
.B KEYCTL_SETPERM
|
2010-02-25 07:29:42 +00:00
|
|
|
Set perms on a key.
|
|
|
|
.TP
|
2012-03-20 17:24:41 +00:00
|
|
|
.B KEYCTL_DESCRIBE
|
2010-02-25 07:29:42 +00:00
|
|
|
Describe a key.
|
|
|
|
.TP
|
2012-03-20 17:24:41 +00:00
|
|
|
.B KEYCTL_CLEAR
|
2010-02-25 07:29:42 +00:00
|
|
|
Clear contents of a keyring.
|
|
|
|
.TP
|
2012-03-20 17:24:41 +00:00
|
|
|
.B KEYCTL_LINK
|
2010-02-25 07:29:42 +00:00
|
|
|
Link a key into a keyring.
|
|
|
|
.TP
|
2012-03-20 17:24:41 +00:00
|
|
|
.B KEYCTL_UNLINK
|
2010-02-25 07:29:42 +00:00
|
|
|
Unlink a key from a keyring.
|
|
|
|
.TP
|
2012-03-20 17:24:41 +00:00
|
|
|
.B KEYCTL_SEARCH
|
2010-02-25 07:29:42 +00:00
|
|
|
Search for a key in a keyring.
|
|
|
|
.TP
|
2012-03-20 17:24:41 +00:00
|
|
|
.B KEYCTL_READ
|
2010-02-25 07:29:42 +00:00
|
|
|
Read a key or keyring's contents.
|
|
|
|
.TP
|
2012-03-20 17:24:41 +00:00
|
|
|
.B KEYCTL_INSTANTIATE
|
2010-02-25 07:29:42 +00:00
|
|
|
Instantiate a partially constructed key.
|
|
|
|
.TP
|
2012-03-20 17:24:41 +00:00
|
|
|
.B KEYCTL_NEGATE
|
2010-02-25 07:29:42 +00:00
|
|
|
Negate a partially constructed key.
|
|
|
|
.TP
|
2012-03-20 17:24:41 +00:00
|
|
|
.B KEYCTL_SET_REQKEY_KEYRING
|
2010-02-25 07:29:42 +00:00
|
|
|
Set default request-key keyring.
|
|
|
|
.TP
|
2012-03-20 17:24:41 +00:00
|
|
|
.B KEYCTL_SET_TIMEOUT
|
2010-02-25 07:29:42 +00:00
|
|
|
Set timeout on a key.
|
|
|
|
.TP
|
2012-03-20 17:24:41 +00:00
|
|
|
.B KEYCTL_ASSUME_AUTHORITY
|
2010-02-25 07:29:42 +00:00
|
|
|
Assume authority to instantiate key.
|
|
|
|
.P
|
|
|
|
These are wrapped by
|
|
|
|
.B libkeyutils
|
|
|
|
into individual functions to permit compiler the compiler to check types.
|
|
|
|
See the
|
|
|
|
.B See Also
|
|
|
|
section at the bottom.
|
|
|
|
.SH RETURN VALUE
|
|
|
|
On success
|
|
|
|
.BR keyctl ()
|
|
|
|
returns the serial number of the key it found.
|
|
|
|
On error, the value
|
|
|
|
.B -1
|
|
|
|
will be returned and errno will have been set to an appropriate error.
|
|
|
|
.SH ERRORS
|
|
|
|
.TP
|
2010-11-01 06:18:03 +00:00
|
|
|
.B EACCES
|
|
|
|
A key operation wasn't permitted.
|
|
|
|
.TP
|
|
|
|
.B EDQUOT
|
|
|
|
The key quota for the caller's user would be exceeded by creating a key or
|
|
|
|
linking it to the keyring.
|
2010-02-25 07:29:42 +00:00
|
|
|
.TP
|
|
|
|
.B EKEYEXPIRED
|
|
|
|
An expired key was found or specified.
|
|
|
|
.TP
|
|
|
|
.B EKEYREJECTED
|
|
|
|
A rejected key was found or specified.
|
|
|
|
.TP
|
2010-11-01 06:18:03 +00:00
|
|
|
.B EKEYREVOKED
|
|
|
|
A revoked key was found or specified.
|
2010-02-25 07:29:42 +00:00
|
|
|
.TP
|
2010-11-01 06:18:03 +00:00
|
|
|
.B ENOKEY
|
|
|
|
No matching key was found or an invalid key was specified.
|
2010-02-25 07:29:42 +00:00
|
|
|
.SH LINKING
|
|
|
|
Although this is a Linux system call, it is not present in
|
|
|
|
.I libc
|
|
|
|
but can be found rather in
|
|
|
|
.IR libkeyutils .
|
|
|
|
When linking,
|
|
|
|
.B -lkeyutils
|
|
|
|
should be specified to the linker.
|
|
|
|
.SH SEE ALSO
|
|
|
|
.BR keyctl (1),
|
|
|
|
.br
|
|
|
|
.BR add_key (2),
|
|
|
|
.br
|
|
|
|
.BR request_key (2),
|
|
|
|
.br
|
|
|
|
.BR keyctl_get_keyring_ID (3),
|
|
|
|
.br
|
|
|
|
.BR keyctl_join_session_keyring (3),
|
|
|
|
.br
|
|
|
|
.BR keyctl_update (3),
|
|
|
|
.br
|
|
|
|
.BR keyctl_revoke (3),
|
|
|
|
.br
|
|
|
|
.BR keyctl_chown (3),
|
|
|
|
.br
|
|
|
|
.BR keyctl_setperm (3),
|
|
|
|
.br
|
|
|
|
.BR keyctl_describe (3),
|
|
|
|
.br
|
|
|
|
.BR keyctl_clear (3),
|
|
|
|
.br
|
|
|
|
.BR keyctl_link (3),
|
|
|
|
.br
|
|
|
|
.BR keyctl_unlink (3),
|
|
|
|
.br
|
|
|
|
.BR keyctl_search (3),
|
|
|
|
.br
|
|
|
|
.BR keyctl_read (3),
|
|
|
|
.br
|
|
|
|
.BR keyctl_instantiate (3),
|
|
|
|
.br
|
|
|
|
.BR keyctl_negate (3),
|
|
|
|
.br
|
|
|
|
.BR keyctl_set_reqkey_keyring (3),
|
|
|
|
.br
|
|
|
|
.BR keyctl_set_timeout (3),
|
|
|
|
.br
|
|
|
|
.BR keyctl_assume_authority (3),
|
|
|
|
.br
|
|
|
|
.BR keyctl_describe_alloc (3),
|
|
|
|
.br
|
|
|
|
.BR keyctl_read_alloc (3),
|
|
|
|
.br
|
|
|
|
.BR request-key (8)
|