Initial import from FreeBSD RELENG_4:
[dragonfly.git] / crypto / heimdal / lib / krb5 / krb5_sname_to_principal.3
1 .\" Copyright (c) 1997 Kungliga Tekniska Högskolan
2 .\" $Id: krb5_sname_to_principal.3,v 1.5 2002/08/28 15:30:56 joda Exp $
3 .Dd August 8, 1997
4 .Dt KRB5_PRINCIPAL 3
5 .Os HEIMDAL
6 .Sh NAME
7 .Nm krb5_sname_to_principal ,
8 .Nm krb5_sock_to_principal
9 .Nd create a service principal
10 .Sh LIBRARY
11 Kerberos 5 Library (libkrb5, -lkrb5)
12 .Sh SYNOPSIS
13 .Fd #include <krb5.h>
14 .Ft krb5_error_code
15 .Fn krb5_sname_to_principal "krb5_context context" "const char *hostname" "const char *sname" "int32_t type" "krb5_principal *principal"
16 .Ft krb5_error_code
17 .Fn krb5_sock_to_principal "krb5_context context" "int socket" "const char *sname" "int32_t type" "krb5_principal *principal"
18 .Sh DESCRIPTION
19 These functions create a
20 .Dq service
21 principal that can, for instance, be used to lookup a key in a keytab. For both these function the
22 .Fa sname
23 parameter will be used for the first component of the created principal. If
24 .Fa sname
25 is
26 .Dv NULL ,
27 .Dq host
28 will be used instead.
29 .Fn krb5_sname_to_principal
30 will use the passed
31 .Fa hostname
32 for the second component. If type
33 .Dv KRB5_NT_SRV_HST
34 this name will be looked up with
35 .Fn gethostbyname .
36 If
37 .Fa hostname is
38 .Dv NULL ,
39 the local hostname will be used.
40 .Pp
41 .Fn krb5_sock_to_principal
42 will use the
43 .Dq sockname
44 of the passed
45 .Fa socket ,
46 which should be a bound
47 .Dv AF_INET
48 socket.
49 .Sh SEE ALSO
50 .Xr krb5_425_conv_principal 3 ,
51 .Xr krb5_build_principal 3 ,
52 .Xr krb5_free_principal 3 ,
53 .Xr krb5_parse_name 3 ,
54 .Xr krb5_unparse_name 3