#ifndef __CREDDY_H__ #define __CREDDY_H__ #include #include #include typedef struct _options_t { int help; int mode; char *cert; // generate options char *cn; int validity; // attribute options char *issuer; char *key; char *role; char *subject; char *subject_role; char *out; } options_t; #define MODE_GENERATE 1 #define MODE_VERIFY 2 #define MODE_KEYID 3 #define MODE_ATTRIBUTE 4 #define MODE_ROLES 5 // returns true if a name starts with a letter and is otherwise alphanumeric int clean_name(char *string); // load an ID cert from file (aborts on fail) certificate_t *cert_from_file(char *filename); // get the keyid from a cert (free result when done) char *cert_keyid(certificate_t *cert); // generate a random serial chunk_t generate_serial(); void usage(options_t *opts); void *xmalloc(size_t len); char *xstrdup(char *string); // sub programs void generate_main(options_t *opts); void keyid_main(options_t *opts); void attribute_main(options_t *opts); #endif /* __CREDDY_H__ */