source: creddy/creddy_common.h @ 8f58012

abac0-leakabac0-meicompt_changesgec13mei-idmei-rt0-nmei_rt0mei_rt2mei_rt2_fix_1meiyap-rt1meiyap1rt2tvf-new-xml
Last change on this file since 8f58012 was 014d2f6, checked in by Mike Ryan <mikeryan@…>, 13 years ago

Merge branch 'attr_bugfix'

  • Property mode set to 100644
File size: 1.4 KB
Line 
1#ifndef __CREDDY_H__
2#define __CREDDY_H__
3
4#include <library.h>
5#include <credentials/certificates/certificate.h>
6#include <credentials/certificates/x509.h>
7
8typedef struct _subject_t {
9    char *cert;
10    char *id;
11    char *role;
12} subject_t;
13
14typedef struct _options_t {
15    int help;
16    int mode;
17
18    char *cert;
19
20    // generate options
21    char *cn;
22    int validity;
23
24    // attribute options
25    char *issuer;
26    char *key;
27    char *role;
28    subject_t *subjects;
29    int num_subjects;
30    char *out;
31
32    // verify options
33    char *attrcert;
34
35    // display options
36    char *show;
37} options_t;
38
39#define MODE_GENERATE   1
40#define MODE_VERIFY     2
41#define MODE_KEYID      3
42#define MODE_ATTRIBUTE  4
43#define MODE_ROLES      5
44#define MODE_VERSION    6
45#define MODE_DISPLAY    7
46
47// returns true if a name starts with a letter and is otherwise alphanumeric
48int clean_name(char *string);
49
50// load an attr cert from file (aborts on fail)
51certificate_t *attr_cert_from_file(char *filename);
52
53// generate a random serial
54chunk_t creddy_generate_serial();
55
56void usage(options_t *opts);
57void *xmalloc(size_t len);
58void *xrealloc(void *ptr, size_t size);
59char *xstrdup(char *string);
60
61// sub programs
62void generate_main(options_t *opts);
63void keyid_main(options_t *opts);
64void attribute_main(options_t *opts);
65void roles_main(options_t *opts);
66void verify_main(options_t *opts);
67void display_main(options_t *opts);
68
69#endif /* __CREDDY_H__ */
Note: See TracBrowser for help on using the repository browser.