a5754c5f6785a58d989ac57e145b454bf3495696
[krb5.git] / src / kadmin / dbutil / kdb5_util.h
1 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /* kadmin/dbutil/kdb5_util.h */
3 /*
4  * Copyright 1992, 2008, 2009 by the Massachusetts Institute of Technology.
5  * All Rights Reserved.
6  *
7  * Export of this software from the United States of America may
8  *   require a specific license from the United States Government.
9  *   It is the responsibility of any person or organization contemplating
10  *   export to obtain such a license before exporting.
11  *
12  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
13  * distribute this software and its documentation for any purpose and
14  * without fee is hereby granted, provided that the above copyright
15  * notice appear in all copies and that both that copyright notice and
16  * this permission notice appear in supporting documentation, and that
17  * the name of M.I.T. not be used in advertising or publicity pertaining
18  * to distribution of the software without specific, written prior
19  * permission.  Furthermore if you modify this software you must label
20  * your software as modified software and not distribute it in such a
21  * fashion that it might be confused with the original M.I.T. software.
22  * M.I.T. makes no representations about the suitability of
23  * this software for any purpose.  It is provided "as is" without express
24  * or implied warranty.
25  */
26
27 #include <kdb_log.h>
28
29 #define MAX_HEADER      1024
30 #define REALM_SEP       '@'
31 #define REALM_SEP_STR   "@"
32
33 extern char *progname;
34 #ifndef V4_DECLARES_STATIC
35 extern krb5_keyblock master_keyblock;
36 extern krb5_principal master_princ;
37 #endif
38 extern krb5_boolean dbactive;
39 extern int exit_status;
40 extern krb5_context util_context;
41 extern kadm5_config_params global_params;
42 extern int valid_master_key;
43 extern krb5_db_entry master_db;
44 extern char **db5util_db_args;
45 extern int    db5util_db_args_size;
46 extern krb5_kvno new_mkvno;
47 extern krb5_keylist_node *master_keylist;
48 extern krb5_keyblock new_master_keyblock;
49 extern int add_db_arg(char *arg);
50
51 extern void usage(void);
52
53 extern void add_key
54 (char const *, char const *,
55  krb5_const_principal, const krb5_keyblock *,
56  krb5_kvno, krb5_keysalt *);
57 extern int set_dbname_help
58 (char *, char *);
59
60 extern char *kdb5_util_Init (int, char **);
61
62 extern int quit (void);
63
64 extern int check_for_match
65 (char *, int, krb5_db_entry *, int, int);
66
67 extern void parse_token
68 (char *, int *, int *, char *);
69
70 extern int create_db_entry (krb5_principal, krb5_db_entry *);
71
72 extern int kadm5_create_magic_princs (kadm5_config_params *params,
73                                       krb5_context context);
74
75 extern int process_ov_principal (char *fname, krb5_context kcontext,
76                                  FILE *filep, int verbose,
77                                  int *linenop);
78
79 extern void load_db (int argc, char **argv);
80 extern void dump_db (int argc, char **argv);
81 extern void kdb5_create (int argc, char **argv);
82 extern void kdb5_destroy (int argc, char **argv);
83 extern void kdb5_stash (int argc, char **argv);
84 extern void kdb5_add_mkey (int argc, char **argv);
85 extern void kdb5_use_mkey (int argc, char **argv);
86 extern void kdb5_list_mkeys (int argc, char **argv);
87 extern void kdb5_update_princ_encryption (int argc, char **argv);
88 extern krb5_error_code master_key_convert(krb5_context context,
89                                           krb5_db_entry *db_entry);
90 extern void kdb5_purge_mkeys (int argc, char **argv);
91
92 extern void update_ok_file (char *file_name);
93
94 extern int kadm5_create (kadm5_config_params *params);
95
96 extern krb5_error_code add_new_mkey(krb5_context, krb5_db_entry *,
97                                     krb5_keyblock *, krb5_kvno);
98
99 extern krb5_kvno get_next_kvno(krb5_context, krb5_db_entry *);
100
101 void usage (void);