Add heimdal-0.6.3
[dragonfly.git] / crypto / heimdal-0.6.3 / lib / krb5 / krb5_principal_get_realm.3
1 .\" Copyright (c) 2001 Kungliga Tekniska Högskolan
2 .\" (Royal Institute of Technology, Stockholm, Sweden). 
3 .\" All rights reserved. 
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without 
6 .\" modification, are permitted provided that the following conditions 
7 .\" are met: 
8 .\"
9 .\" 1. Redistributions of source code must retain the above copyright 
10 .\"    notice, this list of conditions and the following disclaimer. 
11 .\"
12 .\" 2. Redistributions in binary form must reproduce the above copyright 
13 .\"    notice, this list of conditions and the following disclaimer in the 
14 .\"    documentation and/or other materials provided with the distribution. 
15 .\"
16 .\" 3. Neither the name of the Institute nor the names of its contributors 
17 .\"    may be used to endorse or promote products derived from this software 
18 .\"    without specific prior written permission. 
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 
30 .\" SUCH DAMAGE. 
31 .\"
32 .\" $Id: krb5_principal_get_realm.3,v 1.6 2003/04/16 13:58:17 lha Exp $
33 .\"
34 .Dd June 20, 2001
35 .Dt KRB5_PRINCIPAL_GET_REALM 3
36 .Os HEIMDAL
37 .Sh NAME
38 .Nm krb5_principal_get_realm ,
39 .Nm krb5_principal_get_comp_string
40 .Nd decompose a principal
41 .Sh LIBRARY
42 Kerberos 5 Library (libkrb5, -lkrb5)
43 .Sh SYNOPSIS
44 .In krb5.h
45 .Ft "const char *"
46 .Fn krb5_principal_get_realm "krb5_context context" "krb5_principal principal"
47 .Ft "const char *"
48 .Fn krb5_principal_get_comp_string "krb5_context context" "krb5_principal principal" "unsigned int component"
49 .Sh DESCRIPTION
50 These functions return parts of the
51 .Fa principal ,
52 either the realm or a specific component. The returned string points
53 to data inside the principal, so they are valid only as long as the
54 principal exists.
55 .Pp
56 The
57 .Fa component
58 argument to
59 .Fn krb5_principal_get_comp_string
60 is the component number to return, from zero to the total number of
61 components minus one. If a the requested component number is out of range,
62 .Dv NULL
63 is returned.
64 .Pp
65 These functions can be seen as a replacement for the
66 .Fn krb5_princ_realm ,
67 .Fn krb5_princ_component
68 and related macros, described as intermal in the MIT API
69 specification. A difference is that these functions return strings,
70 not
71 .Dv krb5_data .
72 A reason to return
73 .Dv krb5_data
74 was that it was believed that principal components could contain
75 binary data, but this belief was unfounded, and it has been decided
76 that principal components are infact UTF8, so it's safe to use zero
77 terminated strings.
78 .Pp
79 It's generally not necessary to look at the components of a principal.
80 .Sh SEE ALSO
81 .Xr krb5_unparse_name 3