summaryrefslogtreecommitdiffstats
path: root/src/include/krb5/keytab.h
blob: 5d145ad493f44c890ce02d88cd3e4bae3f2e7e9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
 * $Source$
 * $Author$
 * $Id$
 *
 * Copyright 1990 by the Massachusetts Institute of Technology.
 *
 * For copying and distribution information, please see the file
 * <krb5/mit-copyright.h>.
 *
 * Keytab definitions.
 */

#include <krb5/copyright.h>

#ifndef KRB5_KEYTAB__
#define KRB5_KEYTAB__


/* XXX */
#define MAX_KEYTAB_NAME_LEN 1100 /* Long enough for MAXPATHLEN + some extra */

typedef krb5_pointer krb5_kt_cursor;	/* XXX */

typedef struct krb5_keytab_entry_st {
    krb5_principal principal;	/* principal of this key */
    krb5_keyblock *key;		/* the secret key */
    krb5_kvno vno;		/* key version number */
} krb5_keytab_entry;


typedef struct _krb5_kt {
	struct krb5_kt_ops *ops;
	krb5_pointer data;
} *krb5_keytab;


typedef struct _krb5_kt_ops {
	char *prefix;
        /* routines always present */
	krb5_error_code (*resolve) PROTOTYPE((char *,
					      krb5_keytab *));
	krb5_error_code (*get_name) PROTOTYPE((krb5_keytab,
					       char *,
					       int));
	krb5_error_code (*close) PROTOTYPE((krb5_keytab *));
	krb5_error_code (*get) PROTOTYPE((krb5_keytab,
					  krb5_principal,
					  krb5_kvno,
					  krb5_keytab_entry *));
	krb5_error_code (*start_seq_get) PROTOTYPE((krb5_keytab,
						    krb5_kt_cursor *));	
	krb5_error_code (*get_next) PROTOTYPE((krb5_keytab,
					       krb5_keytab_entry *,
					       krb5_kt_cursor));
	krb5_error_code (*end_get) PROTOTYPE((krb5_keytab,
					      krb5_kt_cursor));
	/* routines to be included on extended version (write routines) */
	krb5_error_code (*add) PROTOTYPE((krb5_keytab,
					  krb5_keytab_entry *));
	krb5_error_code (*remove) PROTOTYPE((krb5_keytab,
				  krb5_kt_cursor));
} krb5_kt_ops;

#endif /* KRB5_KEYTAB__ */