svn rev #24912: trunk/doc/doxy_examples/

tsitkova@MIT.EDU tsitkova at MIT.EDU
Tue May 3 10:25:11 EDT 2011


http://src.mit.edu/fisheye/changelog/krb5/?cs=24912
Commit By: tsitkova
Log Message:
API documentation: added a usage example for krb5_verify_init_creds function family



Changed Files:
A   trunk/doc/doxy_examples/verify_init_creds.c
Added: trunk/doc/doxy_examples/verify_init_creds.c
===================================================================
--- trunk/doc/doxy_examples/verify_init_creds.c	                        (rev 0)
+++ trunk/doc/doxy_examples/verify_init_creds.c	2011-05-03 14:25:11 UTC (rev 24912)
@@ -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;
+}
+




More information about the cvs-krb5 mailing list