HP-UX Reference (11i v3 07/02) - 3 Library Functions N-Z (vol 7)

s
secure_rpc(3N) secure_rpc(3N)
int key_decryptsession()
This function is an interface to the keyserver daemon, which is associated with RPC’s secure authenti-
cation system (AUTH_DES authentication). User programs rarely need to call
key_decryptsession()
or the associated functions
key_encryptsession()
,
key_gendes() , and key_setsecret()
.
The
key_decryptsession()
function takes a server netname remotename and a DES key des-
key, and decrypts the key by using the public key of the server and the secret key associated with the
effective UID of the calling process. The
key_decryptsession()
function is the inverse of the
key_encryptsession()
function. The key_decryptsession()
function returns 0 if it
succeeds,
-1 if it fails.
int key_encryptsession()
This function is a keyserver interface routine that takes a server netname remotename and a DES key
deskey, and encrypts the key using the public key of the server and the secret key associated with the
effective UID of the calling process. If the keyserver does not have a key registered for the UID, it
falls back to using the secret key for the netname
nobody unless this feature has been disabled. See
keyserv(1M). The
key_encryptsession()
function is the inverse of the
key_decryptsession()
function. The key_encryptsession() function returns 0 if it
succeeds,
-1 if it fails.
int key_gendes()
This is a keyserver interface function used to ask the keyserver for a secure conversation key. Select-
ing a conversation key at random is generally not secure because the common ways of choosing ran-
dom numbers are too easy to guess. The
key_gendes() function returns 0 if it succeeds, -1
if it
fails.
int key_setsecret()
This is a keyserver interface function used to set the key for the effective UID of the calling process.
This function returns
0 if it succeeds, -1 if it fails.
int key_secretkey_is_set()
This is a keyserver interface function used to determine if a key has been set for the effective UID of
the calling process. If the keyserver has a key stored for the effective UID of the calling process, the
key_secretkey_is_set()
function returns 1. Otherwise it returns 0.
int netname2host()
This function converts an operating system independent netname name to a domain-specific hostname
host. The hostlen parameter is the maximum size of host. The netname2host()
function returns
1 if it succeeds and 0 if it fails. The function is the inverse of the host2netname()
function.
int netname2user()
This function converts an operating system independent netname to a domain-specific user ID. The
netname2user() function returns
1 if it succeeds and 0 if it fails. The function is the inverse of
the
user2netname() function.
The
*uidp parameter is set to the user’s numerical ID associated with name. The
*gidp parameter is
set to the numerical ID of the user’s group. The gidlist parameter contains the numerical IDs of the
other groups to which the user belongs. The
*gidlenp parameter is set to the number of valid group
ID entries specified by the gidlist parameter.
int user2netname()
This function converts a domain-specific username to an operating system independent netname. The
user2netname() function returns 1 if it succeeds and 0 if it fails. The function is the inverse of
the netname2user() function.
MULTITHREAD USAGE
Thread Safe: Yes
Cancel Safe: Yes
Fork Safe: No
Async-cancel Safe: No
Async-signal Safe: No
These functions can be called safely in a multithreaded environment. They may be cancellation points in
that they call functions that are cancel points.
In a multithreaded environment, these functions are not safe to be called by a child process after fork()
and before exec(). These functions should not be called by a multithreaded application that supports
HP-UX 11i Version 3: February 2007 3 Hewlett-Packard Company 381