krb5_build_principal()--Build a Kerberos Principal


  Syntax
 #include <krb5.h>

 krb5_error_code krb5_build_principal(
     krb5_context     context,
     krb5_principal *     ret_principal,  
     int        realm_length,
     krb5_const char *      realm,
     char *       name1, name2, ...); 
  Service Program Name: QSYS/QKRBGSS

  Default Public Authority: *USE

  Threadsafe: Yes

The krb5_build_principal() function builds a Kerberos principal from its component strings.


Authorities

No authorities are required.


Parameters

context  (Input)
The Kerberos context.

ret_principal  (Output)
The Kerberos principal. The krb5_free_principal() routine should be called to release the principal when it is no longer needed.

realm_length  (Input)
The length of the realm name.

realm  (Input)
The realm name.

name1, name2, ...  (Input)
One or more name components. The end of the components is indicated by specifying NULL for the parameter.

Return Value

If no errors occur, the return value is 0. Otherwise, a Kerberos error code is returned.


Error Messages

Message ID Error Message Text
CPE3418 E Possible APAR condition or hardware failure.


Example

The following example creates the principal bambi/admin@forest.

Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.

            
#include <krb5.h>

retval = krb5_build_principal(context, &princ, 6, "forest", "bambi", "admin", NULL);



API introduced: V5R1

[ Back to top | Security APIs | UNIX-Type APIs | APIs by category ]