source: creddy/creddy.h @ 5a72d21

abac0-leakabac0-meicompt_changesgec13mei-idmei-rt0-nmei_rt0mei_rt2mei_rt2_fix_1meiyap-rt1meiyap1rt2tvf-new-xml
Last change on this file since 5a72d21 was 784a398, checked in by Mike Ryan <mikeryan@…>, 14 years ago

creddy verify, all creddy commands done

  • 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;
23    char *subject_role;
24    char *out;
25
26    // verify options
27    char *attrcert;
28} options_t;
29
30#define MODE_GENERATE   1
31#define MODE_VERIFY     2
32#define MODE_KEYID      3
33#define MODE_ATTRIBUTE  4
34#define MODE_ROLES      5
35
36// returns true if a name starts with a letter and is otherwise alphanumeric
37int clean_name(char *string);
38
39// load an ID/attr cert from file (aborts on fail)
40certificate_t *cert_from_file(char *filename);
41certificate_t *attr_cert_from_file(char *filename);
42
43// get the keyid from a cert (free result when done)
44char *cert_keyid(certificate_t *cert);
45
46// generate a random serial
47chunk_t generate_serial();
48
49void usage(options_t *opts);
50void *xmalloc(size_t len);
51char *xstrdup(char *string);
52
53// sub programs
54void generate_main(options_t *opts);
55void keyid_main(options_t *opts);
56void attribute_main(options_t *opts);
57void roles_main(options_t *opts);
58void verify_main(options_t *opts);
59
60#endif /* __CREDDY_H__ */
Note: See TracBrowser for help on using the repository browser.