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