xref: /freebsd/lib/libc/rpc/publickey.3 (revision 02e9120893770924227138ba49df1edb3896112a)
1.\"
2.Dd October 6, 1987
3.Dt PUBLICKEY 3
4.Os
5.Sh NAME
6.Nm publickey , getpublickey , getsecretkey
7.Nd "get public or secret key"
8.Sh LIBRARY
9.Lb librpcsvc
10.Sh SYNOPSIS
11.In rpc/rpc.h
12.In rpc/key_prot.h
13.Ft int
14.Fo getpublickey
15.Fa "const char netname[MAXNETNAMELEN+1]"
16.Fa "char publickey[HEXKEYBYTES+1]"
17.Fc
18.Ft int
19.Fo getsecretkey
20.Fa "char netname[MAXNETNAMELEN+1]"
21.Fa "char secretkey[HEXKEYBYTES+1]"
22.Fa "char *passwd"
23.Fc
24.Sh DESCRIPTION
25These routines are used to get public and secret keys from the
26.Tn YP
27database.
28The
29.Fn getsecretkey
30function
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 NUL 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 NUL
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