krb5_sname_to_principal()--Convert Service Name to a Kerberos Principal


  Syntax
 #include <krb5.h>

 krb5_error_code krb5_sname_to_principal(  
     krb5_context     context,
     krb5_const char *      hostname,  
     krb5_const char *      sname,
     krb5_int32       type,
     krb5_principal *     ret_princ);   
  Service Program Name: QSYS/QKRBGSS

  Default Public Authority: *USE

  Threadsafe: Yes

The krb5_sname_to_principal() function converts a service name and a host name to a Kerberos principal. The principal name is in the format sname/hostname@realm. The realm name that corresponds to the host name is obtained by calling the krb5_get_host_realm() routine.

Not every coded character set identifier (CCSID) contains the '@' character; however, alternative CCSID values often are available. For example, instead of using Greece 423, run the job with a default CCSID of 875.


Authorities

No authorities are required.


Parameters

context  (Input)
The Kerberos context.

hostname  (Input)
The host containing the desired service instance. The local host is used if NULL is specified for this parameter.

sname  (Input)
The service name. The service name is set to the character string "host" if NULL is specified for this parameter.

type  (Input)
The type of host name provided as follows:


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

Return Value

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


Error Messages




API introduced: V5R1

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