1getpublickey(3NSL)   Networking Services Library Functions  getpublickey(3NSL)
2
3
4

NAME

6       getpublickey, getsecretkey, publickey - retrieve public or secret key
7

SYNOPSIS

9       #include <rpc/rpc.h>
10       #include <rpc/key_prot.h>
11
12       int getpublickey(const char netname[MAXNETNAMELEN],
13            char publickey[HEXKEYBYTES+1]);
14
15
16       int getsecretkey(const char netname[MAXNETNAMELEN],
17            char secretkey[HEXKEYBYTES+1],const char *passwd);
18
19

DESCRIPTION

21       The  getpublickey()  and getsecretkey() functions get public and secret
22       keys for netname. The key may come from one of the following sources:
23
24           o      /etc/publickey file. See publickey(4).
25
26           o      NIS   map   ``publickey.byname''   or   the    NIS+    table
27                  ``cred.org_dir''.  The  sources  and  their lookup order are
28                  specified  in  the   /etc/nsswitch.conf   file.   See   nss‐
29                  witch.conf(4).
30
31
32       getsecretkey()  has an extra argument, passwd, which is used to decrypt
33       the encrypted secret key stored in the database.
34

RETURN VALUES

36       Both routines return 1 if they are successful in finding the key.  Oth‐
37       erwise,  the  routines  return  0. The keys are returned as null-termi‐
38       nated, hexadecimal strings. If the password supplied to  getsecretkey()
39       fails  to  decrypt  the  secret  key, the routine will return 1 but the
40       secretkey [0] will be set to NULL.
41

ATTRIBUTES

43       See attributes(5) for descriptions of the following attributes:
44
45
46
47
48       ┌─────────────────────────────┬─────────────────────────────┐
49       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
50       ├─────────────────────────────┼─────────────────────────────┤
51       │MT-Level                     │Safe                         │
52       └─────────────────────────────┴─────────────────────────────┘
53

SEE ALSO

55       secure_rpc(3NSL), nsswitch.conf(4), publickey(4), attributes(5)
56

WARNINGS

58       If getpublickey() gets the public key from any source other than  NIS+,
59       all  authenticated  NIS+  operations may fail. To ensure that this does
60       not happen, edit the nsswitch.conf(4) file to make sure that the public
61       key is obtained from NIS+.
62
63   NOTES
64       NIS+ might not be supported in future releases of the Solaris operating
65       system. Tools to aid the migration from NIS+ to LDAP are  available  in
66       the    current   Solaris   release.   For   more   information,   visit
67       http://www.sun.com/directory/nisplus/transition.html.
68
69
70
71SunOS 5.11                        10 Nov 2005               getpublickey(3NSL)
Impressum