xref: /freebsd/lib/libc/rpc/publickey.3 (revision 1b6c76a2fe091c74f08427e6c870851025a9cf67)
1.\" @(#)publickey.3r	2.1 88/08/07 4.0 RPCSRC
2.\" $FreeBSD$
3.\"
4.Dd October 6, 1987
5.Dt PUBLICKEY 3
6.Os
7.Sh NAME
8.Nm publickey , getpublickey , getsecretkey
9.Nd "get public or secret key"
10.Sh LIBRARY
11.Lb librpcsvc
12.Sh SYNOPSIS
13.Fd "#include <rpc/rpc.h>"
14.Fd "#include <rpc/key_prot.h>"
15.Ft int
16.Fo getpublickey
17.Fa "char netname[MAXNETNAMELEN+1]"
18.Fa "char publickey[HEXKEYBYTES+1]"
19.Fc
20.Ft int
21.Fo getsecretkey
22.Fa "char netname[MAXNETNAMELEN+1]"
23.Fa "char secretkey[HEXKEYBYTES+1]"
24.Fa "char *passwd"
25.Fc
26.Sh DESCRIPTION
27These routines are used to get public and secret keys from the
28.Tn YP
29database.
30.Fn getsecretkey
31has an extra argument,
32.Fa passwd ,
33which is used to decrypt the encrypted secret key stored in the database.
34Both routines return 1 if they are successful in finding the key, 0 otherwise.
35The keys are returned as
36.Dv NULL Ns \-terminated ,
37hexadecimal strings.
38If the password supplied to
39.Fn getsecretkey
40fails to decrypt the secret key, the routine will return 1 but the
41.Fa secretkey
42argument will be a
43.Dv NULL
44string
45.Pq Dq .
46.Sh SEE ALSO
47.Xr publickey 5
48.Pp
49.%T "RPC Programmer's Manual"
50in
51.Pa /usr/share/doc/psd/23.rpc .
52