1 /* keytab.h --- Read MIT style Kerberos Credential Cache file.
2 * Copyright (C) 2006, 2007 Simon Josefsson
4 * This file is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published
6 * by the Free Software Foundation; either version 2 of the License,
7 * or (at your option) any later version.
9 * This file is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this file; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
27 #define KEYTAB_MAX_COMPONENTS 5
28 #define KEYTAB_MAX_KEYLEN 32
36 struct keytab_principal
39 uint16_t num_components
;
40 struct keytab_buffer realm
;
41 struct keytab_buffer components
[KEYTAB_MAX_COMPONENTS
];
44 struct keytab_keyblock
52 char storage
[KEYTAB_MAX_KEYLEN
]; /* usable by caller for storing
53 keys that keyvalue point to. */
59 uint16_t num_components
;
60 struct keytab_principal name
;
62 struct keytab_keyblock key
;
67 uint16_t file_format_version
;
70 struct keytab_principal default_principal
;
71 size_t credentialslen
;
77 extern int keytab_parse (const char *data
, size_t length
, struct keytab
*out
);
79 extern int keytab_parse_entry (const char *data
, size_t len
,
80 struct keytab_entry
*out
,
84 extern void keytab_print (struct keytab
*keytab
);
85 extern void keytab_print_principal (struct keytab_principal
*princ
);
86 extern void keytab_print_entry (struct keytab_entry
*cred
);