Version 2.1.
[krb5dissect.git] / ccache.txt
blob89ec7243f57e2599e903417f4a0669ceb7ab3280
1 The Kerberos Credential Cache Binary File Format
2 Copyright (C) 2006 Simon Josefsson <simon josefsson.org>
3 http://josefsson.org/shishi/ccache.txt
4 Last updated: Sat Sep 23 12:04:11 CEST 2006
6 Like the MIT keytab binary format (see Michael B Allen's reverse
7 engineered description in keytab.txt), the credential cache format is
8 not standard nor documented anywhere.
10 In C style notation, the MIT credential cache file format is as
11 follows.  All values are in network byte order.  All text is ASCII.
13 ccache {
14           uint16_t file_format_version; /* 0x0504 */
15           uint16_t headerlen;           /* only if version is 0x0504 */
16           header headers[];             /* only if version is 0x0504 */
17           principal primary_principal;
18           credential credentials[*];
21 header {
22        uint16_t tag;                    /* 1 = DeltaTime */
23        uint16_t taglen;
24        uint8_t tagdata[taglen]
27 The ccache.taglen and ccache.tags fields are only present in 0x0504
28 versions, not in earlier.  Both MIT and Heimdal appear to correctly
29 ignore unknown tags, so it appears safe to add them (although there is
30 no central place to "register" tags).
32 Currently only one tag is widely implemented, DeltaTime (0x0001).  Its
33 taglen is always 8, and tagdata will contain:
35 DeltaTime {
36        uint32_t time_offset;
37        uint32_t usec_offset;
40 After reading the file_format_version, header tags, and default
41 principal, a list of credentials follow.  You deduce from the file
42 length when there are no more credentials.
44 credential {
45            principal client;
46            principal server;
47            keyblock key;
48            times    time;
49            uint8_t  is_skey;            /* 1 if skey, 0 otherwise */
50            uint32_t tktflags;           /* stored in reversed byte order */
51            uint32_t num_address;
52            address  addrs[num_address];
53            uint32_t num_authdata;
54            authdata authdata[num_authdata];
55            countet_octet_string ticket;
56            countet_octet_string second_ticket;
59 keyblock {
60          uint16_t keytype;
61          uint16_t etype;                /* only present if version 0x0503 */
62          uint16_t keylen;
63          uint8_t keyvalue[keylen];
66 times {
67       uint32_t  authtime;
68       uint32_t  starttime;
69       uint32_t  endtime;
70       uint32_t  renew_till;
73 address {
74         uint16_t addrtype;
75         counted_octet_string addrdata;
78 authdata {
79          uint16_t authtype;
80          counted_octet_string authdata;
83 principal {
84           uint32_t name_type;           /* not present if version 0x0501 */
85           uint32_t num_components;      /* sub 1 if version 0x501 */
86           counted_octet_string realm;
87           counted_octet_string components[num_components];
90 counted_octet_string {
91     uint32_t length;
92     uint8_t data[length];
95 Permission to copy, modify, and distribute this document, with or
96 without modification, for any purpose and without fee or royalty is
97 hereby granted, provided that you include this copyright notice in ALL
98 copies of the document or portions thereof, including modifications.