.\" Copyright (c) 1997, 2001 - 2002 Kungliga Tekniska Högskolan .\" (Royal Institute of Technology, Stockholm, Sweden). .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" 3. Neither the name of the Institute nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $Id: krb5_build_principal.3,v 1.7 2003/04/16 13:58:14 lha Exp $ .\" .Dd August 8, 1997 .Dt KRB5_BUILD_PRINCIPAL 3 .Os HEIMDAL .Sh NAME .Nm krb5_build_principal , .Nm krb5_build_principal_ext , .Nm krb5_build_principal_va , .Nm krb5_build_principal_va_ext , .Nm krb5_make_principal .Nd principal creation functions .Sh LIBRARY Kerberos 5 Library (libkrb5, -lkrb5) .Sh SYNOPSIS .In krb5.h .Ft krb5_error_code .Fn krb5_build_principal "krb5_context context" "krb5_principal *principal" "int realm_len" "krb5_const_realm realm" "..." .Ft krb5_error_code .Fn krb5_build_principal_ext "krb5_context context" "krb5_principal *principal" "int realm_len" "krb5_const_realm realm" "..." .Ft krb5_error_code .Fn krb5_build_principal_va "krb5_context context" "krb5_principal *principal" "int realm_len" "krb5_const_realm realm" "va_list ap" .Ft krb5_error_code .Fn krb5_build_principal_va_ext "krb5_context context" "krb5_principal *principal" "int realm_len" "krb5_const_realm realm" "va_list ap" .Ft krb5_error_code .Fn krb5_make_principal "krb5_context context" "krb5_principal *principal" "krb5_const_realm realm" "..." .Sh DESCRIPTION These functions create a Kerberos 5 principal from a realm and a list of components. All of these functions return an allocated principal in the .Fa principal parameter, this should be freed with .Fn krb5_free_principal after use. .Pp The .Dq build functions take a .Fa realm and the length of the realm. The .Fn krb5_build_principal and .Fn krb5_build_principal_va also takes a list of components (zero-terminated strings), terminated with .Dv NULL . The .Fn krb5_build_principal_ext and .Fn krb5_build_principal_va_ext takes a list of length-value pairs, the list is terminated with a zero length. .Pp The .Fn krb5_make_principal is a wrapper around .Fn krb5_build_principal . If the realm is .Dv NULL , the default realm will be used. .Sh BUGS You can not have a NUL in a component. Until someone can give a good example of where it would be a good idea to have NUL's in a component, this will not be fixed. .Sh SEE ALSO .Xr krb5_425_conv_principal 3 , .Xr krb5_free_principal 3 , .Xr krb5_parse_name 3 , .Xr krb5_sname_to_principal 3 , .Xr krb5_unparse_name 3