source: creddy/creddy.h @ ee5afdd

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
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 _options_t {
9    int help;
10    int mode;
11
12    char *cert;
13
14    // generate options
15    char *cn;
16    int validity;
17
18    // attribute options
19    char *issuer;
20    char *key;
21    char *role;
22    char *subject_cert;
23    char *subject_id;
24    char *subject_role;
25    char *out;
26
27    // verify options
28    char *attrcert;
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
38int clean_name(char *string);
39
40// load an ID/attr cert from file (aborts on fail)
41certificate_t *cert_from_file(char *filename);
42certificate_t *attr_cert_from_file(char *filename);
43
44// get the keyid from a cert (free result when done)
45char *cert_keyid(certificate_t *cert);
46
47// generate a random serial
48chunk_t generate_serial();
49
50void usage(options_t *opts);
51void *xmalloc(size_t len);
52char *xstrdup(char *string);
53
54// sub programs
55void generate_main(options_t *opts);
56void keyid_main(options_t *opts);
57void attribute_main(options_t *opts);
58void roles_main(options_t *opts);
59void verify_main(options_t *opts);
60
61#endif /* __CREDDY_H__ */
Note: See TracBrowser for help on using the repository browser.