.nf
.B #include <sys/types.h>
.B #include <keyutils.h>
-.sp
+.PP
.BI "key_serial_t add_key(const char *" type ", const char *" description ,
.BI " const void *" payload ", size_t " plen ,
.BI " key_serial_t " keyring ");"
.fi
-
+.PP
No glibc wrapper is provided for this system call; see NOTES.
.SH DESCRIPTION
.BR add_key ()
but it does not permit the key to read.
This is suitable for storing payloads
that you do not want to be readable from user space.
-
+.PP
This key type vets the
.I description
to ensure that it is qualified by a "service" prefix,
specified in its command-line arguments,
and links that key into the session keyring.
The following shell session demonstrates the use of the program:
-
+.PP
.in +4n
-.nf
+.EX
$ \fB./a.out user mykey "Some payload"\fP
Key ID is 64a4dca
$ \fBgrep \(aq64a4dca\(aq /proc/keys\fP
064a4dca I--Q--- 1 perm 3f010000 1000 1000 user mykey: 12
-.fi
+.EE
.in
.SS Program source
\&
-.nf
+.EX
#include <sys/types.h>
#include <keyutils.h>
#include <stdio.h>
exit(EXIT_SUCCESS);
}
-.fi
+.EE
.SH SEE ALSO
.ad l
.nh
.BR thread\-keyring (7),
.BR user\-keyring (7),
.BR user\-session\-keyring (7)
-
+.PP
The kernel source files
.IR Documentation/security/keys.txt
and