source: libabac/prover.c @ 6ede88c

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

autoconf/make/libtoolize

  • Property mode set to 100644
File size: 1002 bytes
Line 
1#include <err.h>
2#include <stdio.h>
3
4#include <abac.h>
5
6int main(int argc, char **argv) {
7    int i, success;
8    abac_credential_t *cred;
9
10    if (argc < 2)
11        errx(1, "Usage: %s <keystore>", argv[0]);
12
13    libabac_init();
14
15    abac_context_t *ctx = abac_context_new();
16    abac_context_load_directory(ctx, argv[1]);
17
18    abac_credential_t **credentials = abac_context_query(ctx,
19        "3f1aca4c5911b345d81c5f1a77675dce13249d0c.fed_create",
20        "5839d714b16bbe108642c5eb586c2173420bed19",
21        &success
22    );
23
24    if (success)
25        puts("success");
26
27    if (credentials != NULL)
28        for (i = 0; credentials[i] != NULL; ++i) {
29            cred = credentials[i];
30            printf("credential %s <- %s\n",
31                    abac_role_string(abac_credential_head(cred)),
32                    abac_role_string(abac_credential_tail(cred))
33                  );
34        }
35
36    abac_context_query_free(credentials);
37
38    abac_context_free(ctx);
39
40    libabac_deinit();
41
42    return 0;
43}
Note: See TracBrowser for help on using the repository browser.