8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / man / man3nsl / getpublickey.3nsl
blobcd6e408f0c3bab279e17e8e0461ab096bc04f73e
1 '\" te
2 .\" Copyright 1989 AT&T
3 .\" Copyright (C) 2005, Sun Microsystems, Inc. All Rights Reserved
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH GETPUBLICKEY 3NSL "Feb 25, 2017"
8 .SH NAME
9 getpublickey, getsecretkey, publickey \- retrieve public or secret key
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <rpc/rpc.h>
14 #include <rpc/key_prot.h>
16 \fBint\fR \fBgetpublickey\fR(\fBconst char\fR \fInetname[MAXNETNAMELEN]\fR,
17      \fBchar\fR \fIpublickey[HEXKEYBYTES+1]\fR);
18 .fi
20 .LP
21 .nf
22 \fBint\fR \fBgetsecretkey\fR(\fBconst char\fR \fInetname[MAXNETNAMELEN]\fR,
23      \fBchar\fR \fIsecretkey[HEXKEYBYTES+1]\fR,\fBconst char *\fR\fIpasswd\fR);
24 .fi
26 .SH DESCRIPTION
27 .LP
28 The \fBgetpublickey()\fR and \fBgetsecretkey()\fR functions get public and
29 secret keys for \fInetname\fR. The key may come from one of the following
30 sources:
31 .RS +4
32 .TP
33 .ie t \(bu
34 .el o
35 \fB/etc/publickey\fR file. See \fBpublickey\fR(4).
36 .RE
37 .RS +4
38 .TP
39 .ie t \(bu
40 .el o
41 \fBNIS\fR map ``publickey.byname''.
42 The sources and their lookup order are specified in the
43 \fB/etc/nsswitch.conf\fR file. See \fBnsswitch.conf\fR(4).
44 .RE
45 .sp
46 .LP
47 \fBgetsecretkey()\fR has an extra argument, \fBpasswd\fR, which is used to
48 decrypt the encrypted secret key stored in the database.
49 .SH RETURN VALUES
50 .LP
51 Both routines return \fB1\fR if they are successful in finding the key.
52 Otherwise, the routines return \fB0\fR. The keys are returned as
53 null-terminated, hexadecimal strings. If the password supplied to
54 \fBgetsecretkey()\fR fails to decrypt the secret key, the routine will return 1
55 but the \fIsecretkey\fR [0] will be set to \fINULL\fR.
56 .SH ATTRIBUTES
57 .LP
58 See \fBattributes\fR(5) for descriptions of the following attributes:
59 .sp
61 .sp
62 .TS
63 box;
64 c | c
65 l | l .
66 ATTRIBUTE TYPE  ATTRIBUTE VALUE
68 MT-Level        Safe
69 .TE
71 .SH SEE ALSO
72 .LP
73 \fBsecure_rpc\fR(3NSL), \fBnsswitch.conf\fR(4), \fBpublickey\fR(4),
74 \fBattributes\fR(5)