OSF DCE Application Development Guide--Introduction and Style Guide

Security
In order to save space and to improve the readability of the text, the code shown below
has been slightly edited: all status checks, and all calls to the DCE serviceability
interface (to print or log status or informational messages), have been removed.
3.3.6.1 The managekey Routine
The managekey( ) routine manages the server principal’s key, making sure that it never
expires.
/******
*
* managekey -- Make sure the server principal’s key is changed before
* it expires.
*
* The key management thread which runs this function is created
* in server_get_identity(), below.
*
*
******/
void managekey(char *prin_name){ /* Server principal name */
unsigned32 status;
status = error_status_ok;
sec_key_mgmt_manage_key(
rpc_c_authn_dce_secret, /* Authentication protocol */
KEYTAB, /* Local key file */
(idl_char *)prin_name, /* Principal name */
&status);
}
3.3.6.2 The server_get_identity Routine
The server_get_identity() routine sets up a new server identity.
/******
*
* server_get_identity -- Establish a new server identity with valid
* credentials. This includes setting up a key
* management thread.
*
*
* Called from main().
*
******/
124246 Tandem Computers Incorporated 3 11