source: creddy/roles.c @ 9410b51

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

creddy roles sub command

  • Property mode set to 100644
File size: 631 bytes
Line 
1#include "creddy.h"
2
3#include <credentials/certificates/ac.h>
4
5void roles_main(options_t *opts) {
6    if (opts->cert == NULL)
7        usage(opts);
8
9    certificate_t *cert = lib->creds->create(lib->creds,
10        CRED_CERTIFICATE, CERT_X509_AC,
11        BUILD_FROM_FILE, opts->cert,
12        BUILD_END
13    );
14    if (cert == NULL)
15        errx(1, "Couldn't load attribute cert %s", opts->cert);
16
17    ac_t *ac = (ac_t *)cert;
18    ietf_attributes_t *attr = ac->get_groups(ac);
19    if (attr == NULL)
20        errx(1, "Couldn't get attributes from cert");
21
22    puts(attr->get_string(attr));
23
24    DESTROY_IF(attr);
25    DESTROY_IF(cert);
26}
Note: See TracBrowser for help on using the repository browser.