diff options
| author | Stanislav Sedov <stas@FreeBSD.org> | 2011-10-05 07:23:29 +0000 | 
|---|---|---|
| committer | Stanislav Sedov <stas@FreeBSD.org> | 2011-10-05 07:23:29 +0000 | 
| commit | 7c450da7b446c557e05f34a100b597800967d987 (patch) | |
| tree | 57a48e7e9b592f2d5b713e80a4455820625c2b7b /doc/doxyout/krb5/man/man3/krb5_ccache_intro.3 | |
| parent | b4e3a10e9339a8400197298021d6ca9b8e3aa039 (diff) | |
Diffstat (limited to 'doc/doxyout/krb5/man/man3/krb5_ccache_intro.3')
| -rw-r--r-- | doc/doxyout/krb5/man/man3/krb5_ccache_intro.3 | 69 | 
1 files changed, 69 insertions, 0 deletions
| diff --git a/doc/doxyout/krb5/man/man3/krb5_ccache_intro.3 b/doc/doxyout/krb5/man/man3/krb5_ccache_intro.3 new file mode 100644 index 000000000000..47e73dd6bedb --- /dev/null +++ b/doc/doxyout/krb5/man/man3/krb5_ccache_intro.3 @@ -0,0 +1,69 @@ +.TH "krb5_ccache_intro" 3 "30 Jul 2011" "Version 1.5" "HeimdalKerberos5library" \" -*- nroff -*- +.ad l +.nh +.SH NAME +krb5_ccache_intro \- The credential cache functions  +.SH "Kerberos credential caches" +.PP +krb5_ccache structure holds a Kerberos credential cache. +.PP +Heimdal support the follow types of credential caches: +.PP +.IP "\(bu" 2 +SCC Store the credential in a database +.IP "\(bu" 2 +FILE Store the credential in memory +.IP "\(bu" 2 +MEMORY Store the credential in memory +.IP "\(bu" 2 +API A credential cache server based solution for Mac OS X +.IP "\(bu" 2 +KCM A credential cache server based solution for all platforms +.PP +.SS "Example" +This is a minimalistic version of klist:  +.PP +.nf +#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; + +    if (krb5_init_context (&context) != 0) +        errx(1, 'krb5_context'); + +    ret = krb5_cc_default (context, &id); +    if (ret) +        krb5_err(context, 1, ret, 'krb5_cc_default'); + +    ret = krb5_cc_start_seq_get(context, id, &cursor); +    if (ret) +        krb5_err(context, 1, ret, 'krb5_cc_start_seq_get'); + +    while((ret = krb5_cc_next_cred(context, id, &cursor, &creds)) == 0){ +        char *principal; + +        krb5_unparse_name(context, creds.server, &principal); +        printf('principal: %s\\n', principal); +        free(principal); +        krb5_free_cred_contents (context, &creds); +    } +    ret = krb5_cc_end_seq_get(context, id, &cursor); +    if (ret) +        krb5_err(context, 1, ret, 'krb5_cc_end_seq_get'); + +    krb5_cc_close(context, id); + +    krb5_free_context(context); +    return 0; +} + +.fi +.PP +  | 
