| 1 |
'\" t |
| 2 |
.\" Copyright 2002, Walter Harms <[email protected]> |
| 3 |
.\" Copyright, the authors of the Linux man-pages project |
| 4 |
.\" |
| 5 |
.\" SPDX-License-Identifier: GPL-1.0-or-later |
| 6 |
.\" |
| 7 |
.TH key_setsecret 3 2026-02-08 "Linux man-pages 6.18" |
| 8 |
.SH NAME |
| 9 |
key_decryptsession, key_encryptsession, key_setsecret, key_gendes, |
| 10 |
key_secretkey_is_set \- interfaces to rpc keyserver daemon |
| 11 |
.SH LIBRARY |
| 12 |
Standard C library |
| 13 |
.RI ( libc ,\~ \-lc ) |
| 14 |
.SH SYNOPSIS |
| 15 |
.nf |
| 16 |
.B #include <rpc/rpc.h> |
| 17 |
.P |
| 18 |
.BI "int key_decryptsession(char *" remotename ", des_block *" deskey ); |
| 19 |
.BI "int key_encryptsession(char *" remotename ", des_block *" deskey ); |
| 20 |
.P |
| 21 |
.BI "int key_gendes(des_block *" deskey ); |
| 22 |
.P |
| 23 |
.BI "int key_setsecret(char *" key ); |
| 24 |
.B int key_secretkey_is_set(void); |
| 25 |
.fi |
| 26 |
.SH DESCRIPTION |
| 27 |
The functions here are used within the RPC's secure authentication |
| 28 |
mechanism (AUTH_DES). |
| 29 |
There should be no need for user programs to |
| 30 |
use this functions. |
| 31 |
.P |
| 32 |
The function |
| 33 |
.BR key_decryptsession () |
| 34 |
uses the (remote) server netname and takes the DES key |
| 35 |
for decrypting. |
| 36 |
It uses the public key of the server and the |
| 37 |
secret key associated with the effective UID of the calling process. |
| 38 |
.P |
| 39 |
The function |
| 40 |
.BR key_encryptsession () |
| 41 |
is the inverse of |
| 42 |
.BR key_decryptsession (). |
| 43 |
It encrypts the DES keys with the public key of the server and |
| 44 |
the secret key associated with the effective UID of the calling process. |
| 45 |
.P |
| 46 |
The function |
| 47 |
.BR key_gendes () |
| 48 |
is used to ask the keyserver for a secure conversation key. |
| 49 |
.P |
| 50 |
The function |
| 51 |
.BR key_setsecret () |
| 52 |
is used to set the key for the effective UID of the calling process. |
| 53 |
.P |
| 54 |
The function |
| 55 |
.BR key_secretkey_is_set () |
| 56 |
can be used to determine whether a key has been |
| 57 |
set for the effective UID of the calling process. |
| 58 |
.SH RETURN VALUE |
| 59 |
These functions return 1 on success and 0 on failure. |
| 60 |
.SH ATTRIBUTES |
| 61 |
For an explanation of the terms used in this section, see |
| 62 |
.BR attributes (7). |
| 63 |
.TS |
| 64 |
allbox; |
| 65 |
lbx lb lb |
| 66 |
l l l. |
| 67 |
Interface Attribute Value |
| 68 |
T{ |
| 69 |
.na |
| 70 |
.nh |
| 71 |
.BR key_decryptsession (), |
| 72 |
.BR key_encryptsession (), |
| 73 |
.BR key_gendes (), |
| 74 |
.BR key_setsecret (), |
| 75 |
.BR key_secretkey_is_set () |
| 76 |
T} Thread safety MT-Safe |
| 77 |
.TE |
| 78 |
.SH NOTES |
| 79 |
Note that we talk about two types of encryption here. |
| 80 |
One is asymmetric using a public and secret key. |
| 81 |
The other is symmetric, the |
| 82 |
64-bit DES. |
| 83 |
.P |
| 84 |
These routines were part of the Linux/Doors-project, abandoned by now. |
| 85 |
.SH SEE ALSO |
| 86 |
.BR crypt (3) |