6 static char *mkey_file
;
8 static int version_flag
;
10 struct getargs args
[] = {
11 { "mkey-file", 0, arg_string
, &mkey_file
},
12 { "help", 'h', arg_flag
, &help_flag
},
13 { "version", 0, arg_flag
, &version_flag
}
16 static int num_args
= sizeof(args
) / sizeof(args
[0]);
19 main(int argc
, char **argv
)
26 if(getarg(args
, num_args
, argc
, argv
, &o
))
27 krb5_std_usage(1, args
, num_args
);
30 krb5_std_usage(0, args
, num_args
);
37 ret
= krb5_init_context(&context
);
39 errx(1, "krb5_init_context failed: %d", ret
);
44 ret
= hdb_read_master_key(context
, mkey_file
, &mkey
);
46 krb5_err(context
, 1, ret
, "failed to read master key %s", mkey_file
);
48 hdb_free_master_key(context
, mkey
);
50 krb5_errx(context
, 1, "no command option given");
52 krb5_free_context(context
);