krb5_ccache structure holds a Kerberos credential cache.
#include <krb5.h>
int
main (int argc, char **argv)
{
krb5_context context;
krb5_cc_cursor cursor;
krb5_error_code ret;
krb5_ccache id;
krb5_creds creds;
errx(1, "krb5_context");
if (ret)
krb5_err(context, 1, ret,
"krb5_cc_default");
if (ret)
krb5_err(context, 1, ret,
"krb5_cc_start_seq_get");
char *principal;
printf("principal: %s\\n", principal);
free(principal);
}
if (ret)
krb5_err(context, 1, ret,
"krb5_cc_end_seq_get");
return 0;
}
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_cc_end_seq_get(krb5_context context, const krb5_ccache id, krb5_cc_cursor *cursor)
Definition: cache.c:875
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_cc_start_seq_get(krb5_context context, const krb5_ccache id, krb5_cc_cursor *cursor)
Definition: cache.c:841
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_cc_default(krb5_context context, krb5_ccache *id)
Definition: cache.c:649
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_cc_next_cred(krb5_context context, const krb5_ccache id, krb5_cc_cursor *cursor, krb5_creds *creds)
Definition: cache.c:859
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_cc_close(krb5_context context, krb5_ccache id)
Definition: cache.c:712
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_err(krb5_context context, int eval, krb5_error_code code, const char *fmt,...) __attribute__((__noreturn__
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_unparse_name(krb5_context context, krb5_const_principal principal, char **name)
Definition: principal.c:608
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_init_context(krb5_context *context)
Definition: context.c:417
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_free_cred_contents(krb5_context context, krb5_creds *c)
Definition: creds.c:49
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_free_context(krb5_context context)
Definition: context.c:615