1 .TH "Heimdal Kerberos 5 keytab handling functions" 3 "11 Jan 2012" "Version 1.5.2" "HeimdalKerberos5library" \" -*- nroff -*-
5 Heimdal Kerberos 5 keytab handling functions \-
10 .RI "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL \fBkrb5_kt_register\fP (krb5_context context, const krb5_kt_ops *ops)"
13 .RI "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL \fBkrb5_kt_resolve\fP (krb5_context context, const char *name, krb5_keytab *id)"
16 .RI "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL \fBkrb5_kt_default_name\fP (krb5_context context, char *name, size_t namesize)"
19 .RI "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL \fBkrb5_kt_default_modify_name\fP (krb5_context context, char *name, size_t namesize)"
22 .RI "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL \fBkrb5_kt_default\fP (krb5_context context, krb5_keytab *id)"
25 .RI "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL \fBkrb5_kt_read_service_key\fP (krb5_context context, krb5_pointer keyprocarg, krb5_principal principal, krb5_kvno vno, krb5_enctype enctype, krb5_keyblock **key)"
28 .RI "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL \fBkrb5_kt_get_type\fP (krb5_context context, krb5_keytab keytab, char *prefix, size_t prefixsize)"
31 .RI "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL \fBkrb5_kt_get_name\fP (krb5_context context, krb5_keytab keytab, char *name, size_t namesize)"
34 .RI "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL \fBkrb5_kt_get_full_name\fP (krb5_context context, krb5_keytab keytab, char **str)"
37 .RI "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL \fBkrb5_kt_close\fP (krb5_context context, krb5_keytab id)"
40 .RI "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL \fBkrb5_kt_destroy\fP (krb5_context context, krb5_keytab id)"
43 .RI "KRB5_LIB_FUNCTION krb5_boolean KRB5_LIB_CALL \fBkrb5_kt_compare\fP (krb5_context context, krb5_keytab_entry *entry, krb5_const_principal principal, krb5_kvno vno, krb5_enctype enctype)"
46 .RI "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL \fBkrb5_kt_get_entry\fP (krb5_context context, krb5_keytab id, krb5_const_principal principal, krb5_kvno kvno, krb5_enctype enctype, krb5_keytab_entry *entry)"
49 .RI "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL \fBkrb5_kt_copy_entry_contents\fP (krb5_context context, const krb5_keytab_entry *in, krb5_keytab_entry *out)"
52 .RI "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL \fBkrb5_kt_free_entry\fP (krb5_context context, krb5_keytab_entry *entry)"
55 .RI "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL \fBkrb5_kt_start_seq_get\fP (krb5_context context, krb5_keytab id, krb5_kt_cursor *cursor)"
58 .RI "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL \fBkrb5_kt_next_entry\fP (krb5_context context, krb5_keytab id, krb5_keytab_entry *entry, krb5_kt_cursor *cursor)"
61 .RI "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL \fBkrb5_kt_end_seq_get\fP (krb5_context context, krb5_keytab id, krb5_kt_cursor *cursor)"
64 .RI "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL \fBkrb5_kt_add_entry\fP (krb5_context context, krb5_keytab id, krb5_keytab_entry *entry)"
67 .RI "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL \fBkrb5_kt_remove_entry\fP (krb5_context context, krb5_keytab id, krb5_keytab_entry *entry)"
70 .RI "KRB5_LIB_FUNCTION krb5_boolean KRB5_LIB_CALL \fBkrb5_kt_have_content\fP (krb5_context context, krb5_keytab id)"
73 .SH "Detailed Description"
76 .SH "Function Documentation"
78 .SS "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_kt_add_entry (krb5_context context, krb5_keytab id, krb5_keytab_entry * entry)"
80 Add the entry in `entry' to the keytab `id'.
84 \fIcontext\fP a Keberos context.
88 \fIentry\fP the entry to add
93 Return an error code or 0, see krb5_get_error_message().
97 .SS "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_kt_close (krb5_context context, krb5_keytab id)"
99 Finish using the keytab in `id'. All resources will be released, even on errors.
103 \fIcontext\fP a Keberos context.
105 \fIid\fP keytab to close.
110 Return an error code or 0, see krb5_get_error_message().
114 .SS "KRB5_LIB_FUNCTION krb5_boolean KRB5_LIB_CALL krb5_kt_compare (krb5_context context, krb5_keytab_entry * entry, krb5_const_principal principal, krb5_kvno vno, krb5_enctype enctype)"
116 Compare `entry' against `principal, vno, enctype'. Any of `principal, vno, enctype' might be 0 which acts as a wildcard. Return TRUE if they compare the same, FALSE otherwise.
120 \fIcontext\fP a Keberos context.
122 \fIentry\fP an entry to match with.
124 \fIprincipal\fP principal to match, NULL matches all principals.
126 \fIvno\fP key version to match, 0 matches all key version numbers.
128 \fIenctype\fP encryption type to match, 0 matches all encryption types.
133 Return TRUE or match, FALSE if not matched.
137 .SS "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_kt_copy_entry_contents (krb5_context context, const krb5_keytab_entry * in, krb5_keytab_entry * out)"
139 Copy the contents of `in' into `out'.
143 \fIcontext\fP a Keberos context.
145 \fIin\fP the keytab entry to copy.
147 \fIout\fP the copy of the keytab entry, free with \fBkrb5_kt_free_entry()\fP.
152 Return an error code or 0, see krb5_get_error_message().
156 .SS "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_kt_default (krb5_context context, krb5_keytab * id)"
158 Set `id' to the default keytab.
162 \fIcontext\fP a Keberos context.
164 \fIid\fP the new default keytab.
169 Return an error code or 0, see krb5_get_error_message().
173 .SS "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_kt_default_modify_name (krb5_context context, char * name, size_t namesize)"
175 Copy the name of the default modify keytab into `name'.
179 \fIcontext\fP a Keberos context.
181 \fIname\fP buffer where the name will be written
183 \fInamesize\fP length of name
188 Return an error code or 0, see krb5_get_error_message().
192 .SS "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_kt_default_name (krb5_context context, char * name, size_t namesize)"
194 copy the name of the default keytab into `name'.
198 \fIcontext\fP a Keberos context.
200 \fIname\fP buffer where the name will be written
202 \fInamesize\fP length of name
207 Return an error code or 0, see krb5_get_error_message().
211 .SS "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_kt_destroy (krb5_context context, krb5_keytab id)"
213 Destroy (remove) the keytab in `id'. All resources will be released, even on errors, does the equvalment of \fBkrb5_kt_close()\fP on the resources.
217 \fIcontext\fP a Keberos context.
219 \fIid\fP keytab to destroy.
224 Return an error code or 0, see krb5_get_error_message().
228 .SS "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_kt_end_seq_get (krb5_context context, krb5_keytab id, krb5_kt_cursor * cursor)"
230 Release all resources associated with `cursor'.
234 \fIcontext\fP a Keberos context.
238 \fIcursor\fP the cursor to free.
243 Return an error code or 0, see krb5_get_error_message().
247 .SS "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_kt_free_entry (krb5_context context, krb5_keytab_entry * entry)"
249 Free the contents of `entry'.
253 \fIcontext\fP a Keberos context.
255 \fIentry\fP the entry to free
260 Return an error code or 0, see krb5_get_error_message().
264 .SS "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_kt_get_entry (krb5_context context, krb5_keytab id, krb5_const_principal principal, krb5_kvno kvno, krb5_enctype enctype, krb5_keytab_entry * entry)"
266 Retrieve the keytab entry for `principal, kvno, enctype' into `entry' from the keytab `id'. Matching is done like \fBkrb5_kt_compare()\fP.
270 \fIcontext\fP a Keberos context.
274 \fIprincipal\fP principal to match, NULL matches all principals.
276 \fIkvno\fP key version to match, 0 matches all key version numbers.
278 \fIenctype\fP encryption type to match, 0 matches all encryption types.
280 \fIentry\fP the returned entry, free with \fBkrb5_kt_free_entry()\fP.
285 Return an error code or 0, see krb5_get_error_message().
289 .SS "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_kt_get_full_name (krb5_context context, krb5_keytab keytab, char ** str)"
291 Retrieve the full name of the keytab `keytab' and store the name in `str'.
295 \fIcontext\fP a Keberos context.
297 \fIkeytab\fP keytab to get name for.
299 \fIstr\fP the name of the keytab name, usee krb5_xfree() to free the string. On error, *str is set to NULL.
304 Return an error code or 0, see krb5_get_error_message().
308 .SS "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_kt_get_name (krb5_context context, krb5_keytab keytab, char * name, size_t namesize)"
310 Retrieve the name of the keytab `keytab' into `name', `namesize'
314 \fIcontext\fP a Keberos context.
316 \fIkeytab\fP the keytab to get the name for.
318 \fIname\fP name buffer.
320 \fInamesize\fP size of name buffer.
325 Return an error code or 0, see krb5_get_error_message().
329 .SS "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_kt_get_type (krb5_context context, krb5_keytab keytab, char * prefix, size_t prefixsize)"
331 Return the type of the `keytab' in the string `prefix of length `prefixsize'.
335 \fIcontext\fP a Keberos context.
337 \fIkeytab\fP the keytab to get the prefix for
339 \fIprefix\fP prefix buffer
341 \fIprefixsize\fP length of prefix buffer
346 Return an error code or 0, see krb5_get_error_message().
350 .SS "KRB5_LIB_FUNCTION krb5_boolean KRB5_LIB_CALL krb5_kt_have_content (krb5_context context, krb5_keytab id)"
352 Return true if the keytab exists and have entries
356 \fIcontext\fP a Keberos context.
363 Return an error code or 0, see krb5_get_error_message().
367 .SS "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_kt_next_entry (krb5_context context, krb5_keytab id, krb5_keytab_entry * entry, krb5_kt_cursor * cursor)"
369 Get the next entry from keytab, advance the cursor. On last entry the function will return KRB5_KT_END.
373 \fIcontext\fP a Keberos context.
377 \fIentry\fP the returned entry, free with \fBkrb5_kt_free_entry()\fP.
379 \fIcursor\fP the cursor of the iteration.
384 Return an error code or 0, see krb5_get_error_message().
388 .SS "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_kt_read_service_key (krb5_context context, krb5_pointer keyprocarg, krb5_principal principal, krb5_kvno vno, krb5_enctype enctype, krb5_keyblock ** key)"
390 Read the key identified by `(principal, vno, enctype)' from the keytab in `keyprocarg' (the default if == NULL) into `*key'.
394 \fIcontext\fP a Keberos context.
409 Return an error code or 0, see krb5_get_error_message().
413 .SS "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_kt_register (krb5_context context, const krb5_kt_ops * ops)"
415 Register a new keytab backend.
419 \fIcontext\fP a Keberos context.
421 \fIops\fP a backend to register.
426 Return an error code or 0, see krb5_get_error_message().
430 .SS "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_kt_remove_entry (krb5_context context, krb5_keytab id, krb5_keytab_entry * entry)"
432 Remove an entry from the keytab, matching is done using \fBkrb5_kt_compare()\fP.
436 \fIcontext\fP a Keberos context.
440 \fIentry\fP the entry to remove
445 Return an error code or 0, see krb5_get_error_message().
449 .SS "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_kt_resolve (krb5_context context, const char * name, krb5_keytab * id)"
451 Resolve the keytab name (of the form `type:residual') in `name' into a keytab in `id'.
455 \fIcontext\fP a Keberos context.
457 \fIname\fP name to resolve
459 \fIid\fP resulting keytab, free with \fBkrb5_kt_close()\fP.
464 Return an error code or 0, see krb5_get_error_message().
468 .SS "KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_kt_start_seq_get (krb5_context context, krb5_keytab id, krb5_kt_cursor * cursor)"
470 Set `cursor' to point at the beginning of `id'.
474 \fIcontext\fP a Keberos context.
478 \fIcursor\fP a newly allocated cursor, free with \fBkrb5_kt_end_seq_get()\fP.
483 Return an error code or 0, see krb5_get_error_message().