getkey(3N) getkey(3N)
NAME
getkey - retrieve an authentication key
SYNOPSIS
cc [options] file -lnsl
#include <cr1.h>
int getkey(char *scheme, char *local_principal, char *remote_principal);
Parameters
scheme
points to the authentication scheme identifier
local_principal
points to the local entity referenced by the
authentication key
remote_principal
points to the remote entity referenced by the
authentication key
DESCRIPTION
getkey is a library function that retrieves authentication
keys from a key management daemon.
scheme is the name of the authentication scheme for which the
keys should be obtained (such as cr1). local_principal
indicates the name of the local entity for which the
corresponding key should be obtained. remote_principal
indicates the name of the remote entity for which the
corresponding key should be obtained.
A principal name can have either of the following forms:
name@system
system!name
where name is the logname of the principal for which the key
should be obtained, and system is the name of the system on
which the logname resides.
Users may use getkey to obtain their own keys for use in
authentication. In addition, a privileged user may obtain
keys for any user. A privileged user is the owner of the keys
file.
Copyright 1994 Novell, Inc. Page 1
getkey(3N) getkey(3N)
If local_principal is a NULL pointer, the principal name
corresponding to the effective uid of the application is used.
The @system or system! portion of the principal name is
optional for the local-principal, and the name@ or !name
portion is optional for the remote_principal.
Also, the name for local_principal is equivalent to name@ and
name@local_system. The system for remote_principal is
equivalent to the remote privileged user indicated by @system,
but not to root@system.
Return Values
getkey returns NULL if the daemon cannot be contacted or if
the daemon rejects the request; otherwise, it returns a
pointer to the key. The pointer references static storage,
which is overwritten on subsequent calls. For multi-threaded
applications, information is maintained on a per thread basis.
Files
/etc/iaf/cr1/keys cr1 key database
REFERENCES
cr1(1M), cryptkey(1), keymaster(1M)
Copyright 1994 Novell, Inc. Page 2