diff options
| author | Cy Schubert <cy@FreeBSD.org> | 2017-07-07 17:03:42 +0000 | 
|---|---|---|
| committer | Cy Schubert <cy@FreeBSD.org> | 2017-07-07 17:03:42 +0000 | 
| commit | 33a9b234e7087f573ef08cd7318c6497ba08b439 (patch) | |
| tree | d0ea40ad3bf5463a3c55795977c71bcb7d781b4b /doc/doxy_examples/verify_init_creds.c | |
Diffstat (limited to 'doc/doxy_examples/verify_init_creds.c')
| -rw-r--r-- | doc/doxy_examples/verify_init_creds.c | 28 | 
1 files changed, 28 insertions, 0 deletions
diff --git a/doc/doxy_examples/verify_init_creds.c b/doc/doxy_examples/verify_init_creds.c new file mode 100644 index 000000000000..c22e2528424e --- /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; +} +  | 
