From: Zhanna Tsitkov Date: Tue, 3 May 2011 14:25:11 +0000 (+0000) Subject: API documentation: added a usage example for krb5_verify_init_creds function family X-Git-Tag: krb5-1.10-alpha1~440 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=242e9272e5b3f480cd1ab231368a3bc6e61d1e15;p=krb5.git API documentation: added a usage example for krb5_verify_init_creds function family git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24912 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/doc/doxy_examples/verify_init_creds.c b/doc/doxy_examples/verify_init_creds.c new file mode 100644 index 000000000..c22e25284 --- /dev/null +++ b/doc/doxy_examples/verify_init_creds.c @@ -0,0 +1,28 @@ +/** @example verify_init_creds.c + * + * Usage example for krb5_verify_init_creds function family + */ +#include "k5-int.h" + +krb5_error_code +func(krb5_context context, krb5_creds *creds, krb5_principal server_principal) +{ + krb5_error_code ret = KRB5_OK; + krb5_verify_init_creds_opt options; + + krb5_verify_init_creds_opt_init (&options); + krb5_verify_init_creds_opt_set_ap_req_nofail (&options, 1); + + ret = krb5_verify_init_creds(context, + creds, + server_principal, + NULL /* use default keytab */, + NULL /* don't store creds in ccache */, + &options); + if (ret) { + /* error while verifying credentials for server */ + } + + return ret; +} +