secure_rpc.3n (2010 09)
s
secure_rpc(3N) secure_rpc(3N)
function uses the domain hp.example.com
rather than the default domain name of the machine.
int key_decryptsession()
This function is an interface to the keyserver daemon, which is associated with RPC’s secure
authentication 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 dis-
abled. 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.
Selecting a conversation key at random is generally not secure because the common ways of choos-
ing random 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 host-
name 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() func-
tion.
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.
HP-UX 11i Version 3: September 2010 − 3 − Hewlett-Packard Company 3