KRB5_GET_CREDS(3)        BSD Library Functions Manual        KRB5_GET_CREDS(3)

[1mNAME[0m
     [1mkrb5_get_creds[22m, [1mkrb5_get_creds_opt_add_options[22m, [1mkrb5_get_creds_opt_alloc[22m,
     [1mkrb5_get_creds_opt_free[22m, [1mkrb5_get_creds_opt_set_enctype[22m,
     [1mkrb5_get_creds_opt_set_impersonate[22m, [1mkrb5_get_creds_opt_set_options[22m,
     [1mkrb5_get_creds_opt_set_ticket [22m-- get credentials from the KDC

[1mLIBRARY[0m
     Kerberos 5 Library (libkrb5, -lkrb5)

[1mSYNOPSIS[0m
     [1m#include <krb5.h>[0m

     [4mkrb5_error_code[0m
     [1mkrb5_get_creds[22m([4mkrb5_context[24m [4mcontext[24m, [4mkrb5_get_creds_opt[24m [4mopt[24m,
         [4mkrb5_ccache[24m [4mccache[24m, [4mkrb5_const_principal[24m [4minprinc[24m,
         [4mkrb5_creds[24m [4m**out_creds[24m);

     [4mvoid[0m
     [1mkrb5_get_creds_opt_add_options[22m([4mkrb5_context[24m [4mcontext[24m,
         [4mkrb5_get_creds_opt[24m [4mopt[24m, [4mkrb5_flags[24m [4moptions[24m);

     [4mkrb5_error_code[0m
     [1mkrb5_get_creds_opt_alloc[22m([4mkrb5_context[24m [4mcontext[24m, [4mkrb5_get_creds_opt[24m [4m*opt[24m);

     [4mvoid[0m
     [1mkrb5_get_creds_opt_free[22m([4mkrb5_context[24m [4mcontext[24m, [4mkrb5_get_creds_opt[24m [4mopt[24m);

     [4mvoid[0m
     [1mkrb5_get_creds_opt_set_enctype[22m([4mkrb5_context[24m [4mcontext[24m,
         [4mkrb5_get_creds_opt[24m [4mopt[24m, [4mkrb5_enctype[24m [4menctype[24m);

     [4mkrb5_error_code[0m
     [1mkrb5_get_creds_opt_set_impersonate[22m([4mkrb5_context[24m [4mcontext[24m,
         [4mkrb5_get_creds_opt[24m [4mopt[24m, [4mkrb5_const_principal[24m [4mself[24m);

     [4mvoid[0m
     [1mkrb5_get_creds_opt_set_options[22m([4mkrb5_context[24m [4mcontext[24m,
         [4mkrb5_get_creds_opt[24m [4mopt[24m, [4mkrb5_flags[24m [4moptions[24m);

     [4mkrb5_error_code[0m
     [1mkrb5_get_creds_opt_set_ticket[22m([4mkrb5_context[24m [4mcontext[24m,
         [4mkrb5_get_creds_opt[24m [4mopt[24m, [4mconst[24m [4mTicket[24m [4m*ticket[24m);

[1mDESCRIPTION[0m
     [1mkrb5_get_creds[22m() fetches credentials specified by [4mopt[24m by first looking in
     the [4mccache[24m, and then it doesn't exists, fetch the credential from the KDC
     using the krbtgts in [4mccache[24m.  The credential is returned in [4mout_creds[24m and
     should be freed using the function [1mkrb5_free_creds[22m().

     The structure krb5_get_creds_opt controls the behavior of
     [1mkrb5_get_creds[22m().  The structure is opaque to consumers that can set the
     content of the structure with accessors functions. All accessor functions
     make copies of the data that is passed into accessor functions, so exter-
     nal consumers free the memory before calling [1mkrb5_get_creds[22m().

     The structure krb5_get_creds_opt is allocated with
     [1mkrb5_get_creds_opt_alloc[22m() and freed with [1mkrb5_get_creds_opt_free[22m().  The
     free function also frees the content of the structure set by the accessor
     functions.

     [1mkrb5_get_creds_opt_add_options[22m() and [1mkrb5_get_creds_opt_set_options[22m()
     adds and sets options to the krb5_get_creds_opt structure .  The possible
     options to set are
     KRB5_GC_CACHED     Only check the [4mccache[24m, don't got out on network to
                        fetch credential.
     KRB5_GC_USER_USER  request a user to user ticket.  This options doesn't
                        store the resulting user to user credential in the
                        [4mccache[24m.
     KRB5_GC_EXPIRED_OK
                        returns the credential even if it is expired, default
                        behavior is trying to refetch the credential from the
                        KDC.
     KRB5_GC_NO_STORE   Do not store the resulting credentials in the [4mccache[24m.

     [1mkrb5_get_creds_opt_set_enctype[22m() sets the preferred encryption type of
     the application. Don't set this unless you have to since if there is no
     match in the KDC, the function call will fail.

     [1mkrb5_get_creds_opt_set_impersonate[22m() sets the principal to impersonate.,
     Returns a ticket that have the impersonation principal as a client and
     the requestor as the service. Note that the requested principal have to
     be the same as the client principal in the krbtgt.

     [1mkrb5_get_creds_opt_set_ticket[22m() sets the extra ticket used in user-to-
     user or contrained delegation use case.

[1mSEE ALSO[0m
     krb5(3), krb5_get_credentials(3), krb5.conf(5)

HEIMDAL                          June 15, 2006                         HEIMDAL
