source:
creddy/creddy.h
@
3ba7805
Last change on this file since 3ba7805 was 19be896, checked in by , 14 years ago | |
---|---|
|
|
File size: 1.3 KB |
Rev | Line | |
---|---|---|
[abd7c25] | 1 | #ifndef __CREDDY_H__ |
2 | #define __CREDDY_H__ | |
3 | ||
[fd0febd] | 4 | #include <library.h> |
5 | #include <credentials/certificates/certificate.h> | |
6 | #include <credentials/certificates/x509.h> | |
7 | ||
[abd7c25] | 8 | typedef struct _options_t { |
9 | int help; | |
10 | int mode; | |
11 | ||
[fd0febd] | 12 | char *cert; |
13 | ||
[abd7c25] | 14 | // generate options |
15 | char *cn; | |
16 | int validity; | |
[085f159] | 17 | |
18 | // attribute options | |
19 | char *issuer; | |
20 | char *key; | |
21 | char *role; | |
[ee5afdd] | 22 | char *subject_cert; |
23 | char *subject_id; | |
[085f159] | 24 | char *subject_role; |
25 | char *out; | |
[784a398] | 26 | |
27 | // verify options | |
28 | char *attrcert; | |
[abd7c25] | 29 | } options_t; |
30 | ||
31 | #define MODE_GENERATE 1 | |
32 | #define MODE_VERIFY 2 | |
33 | #define MODE_KEYID 3 | |
34 | #define MODE_ATTRIBUTE 4 | |
35 | #define MODE_ROLES 5 | |
[19be896] | 36 | #define MODE_VERSION 6 |
[abd7c25] | 37 | |
38 | // returns true if a name starts with a letter and is otherwise alphanumeric | |
39 | int clean_name(char *string); | |
40 | ||
[784a398] | 41 | // load an ID/attr cert from file (aborts on fail) |
[fd0febd] | 42 | certificate_t *cert_from_file(char *filename); |
[784a398] | 43 | certificate_t *attr_cert_from_file(char *filename); |
[fd0febd] | 44 | |
45 | // get the keyid from a cert (free result when done) | |
46 | char *cert_keyid(certificate_t *cert); | |
47 | ||
[085f159] | 48 | // generate a random serial |
49 | chunk_t generate_serial(); | |
50 | ||
[abd7c25] | 51 | void usage(options_t *opts); |
52 | void *xmalloc(size_t len); | |
53 | char *xstrdup(char *string); | |
54 | ||
55 | // sub programs | |
56 | void generate_main(options_t *opts); | |
[fd0febd] | 57 | void keyid_main(options_t *opts); |
[085f159] | 58 | void attribute_main(options_t *opts); |
[9410b51] | 59 | void roles_main(options_t *opts); |
[784a398] | 60 | void verify_main(options_t *opts); |
[abd7c25] | 61 | |
62 | #endif /* __CREDDY_H__ */ |
Note: See TracBrowser
for help on using the repository browser.