1 /* ccache.h --- Read/write 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 CCACHE_MAX_COMPONENTS 5
28 #define CCACHE_MAX_KEYLEN 32
43 struct ccache_principal
46 uint32_t num_components
;
47 struct ccache_buffer realm
;
48 struct ccache_buffer components
[CCACHE_MAX_COMPONENTS
];
51 struct ccache_keyblock
57 char storage
[CCACHE_MAX_KEYLEN
]; /* usable by caller for storing
58 keys that keyvalue point to. */
61 struct ccache_credential
63 struct ccache_principal client
;
64 struct ccache_principal server
;
65 struct ccache_keyblock key
;
72 struct ccache_buffer ticket
;
73 struct ccache_buffer second_ticket
;
78 uint16_t file_format_version
;
81 struct ccache_principal default_principal
;
82 size_t credentialslen
;
86 extern int ccache_parse (const char *data
, size_t length
, struct ccache
*out
);
88 extern int ccache_parse_credential (const char *data
, size_t len
,
89 struct ccache_credential
*out
,
92 extern int ccache_pack (struct ccache
*info
, char *data
, size_t *len
);
93 extern int ccache_pack_credential (struct ccache_credential
*cred
,
94 char *out
, size_t *len
);
97 extern void ccache_print (struct ccache
*ccache
);
98 extern void ccache_print_principal (struct ccache_principal
*princ
);
99 extern void ccache_print_credential (struct ccache_credential
*cred
);
102 #endif /* CCACHE_H */