source: libabac/prover.c @ e96c107

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

match example keystore

  • Property mode set to 100644
File size: 1008 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        "06df985dc065fc69b508f6afa8dd127cd29ccc62.fed_create",
20        "ef3584d91703acc4d9cb0f1f0950a31fc89e0b4c",
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_credentials_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.