abac0-leakabac0-meicompt_changesgec13mei-idmei-rt0-nmei_rt0mei_rt2mei_rt2_fix_1meiyap-rt1meiyap1rt2tvf-new-xml
Last change
on this file since ee5afdd was
ee5afdd,
checked in by Mike Ryan <mikeryan@…>, 14 years ago
|
support subject-cert and subject-id
|
-
Property mode set to
100644
|
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 |
---|
| 36 | |
---|
| 37 | // returns true if a name starts with a letter and is otherwise alphanumeric |
---|
| 38 | int clean_name(char *string); |
---|
| 39 | |
---|
[784a398] | 40 | // load an ID/attr cert from file (aborts on fail) |
---|
[fd0febd] | 41 | certificate_t *cert_from_file(char *filename); |
---|
[784a398] | 42 | certificate_t *attr_cert_from_file(char *filename); |
---|
[fd0febd] | 43 | |
---|
| 44 | // get the keyid from a cert (free result when done) |
---|
| 45 | char *cert_keyid(certificate_t *cert); |
---|
| 46 | |
---|
[085f159] | 47 | // generate a random serial |
---|
| 48 | chunk_t generate_serial(); |
---|
| 49 | |
---|
[abd7c25] | 50 | void usage(options_t *opts); |
---|
| 51 | void *xmalloc(size_t len); |
---|
| 52 | char *xstrdup(char *string); |
---|
| 53 | |
---|
| 54 | // sub programs |
---|
| 55 | void generate_main(options_t *opts); |
---|
[fd0febd] | 56 | void keyid_main(options_t *opts); |
---|
[085f159] | 57 | void attribute_main(options_t *opts); |
---|
[9410b51] | 58 | void roles_main(options_t *opts); |
---|
[784a398] | 59 | void verify_main(options_t *opts); |
---|
[abd7c25] | 60 | |
---|
| 61 | #endif /* __CREDDY_H__ */ |
---|
Note: See
TracBrowser
for help on using the repository browser.