source:
libabac/prover_plus.cc
@
314869f
Last change on this file since 314869f was 6ede88c, checked in by , 14 years ago | |
---|---|
|
|
File size: 834 bytes |
Rev | Line | |
---|---|---|
[64fa9ba] | 1 | #include <err.h> |
2 | #include <stdio.h> | |
[9dffbd6] | 3 | #include <vector> |
[64fa9ba] | 4 | |
[6ede88c] | 5 | #include <abac.hh> |
[64fa9ba] | 6 | |
7 | using namespace ABAC; | |
[9dffbd6] | 8 | using std::vector; |
[64fa9ba] | 9 | |
10 | int main(int argc, char **argv) { | |
11 | int i; | |
12 | abac_credential_t *cred; | |
13 | ||
14 | if (argc < 2) | |
15 | errx(1, "Usage: %s <keystore>", argv[0]); | |
16 | ||
17 | libabac_init(); | |
18 | ||
19 | Context ctx; | |
20 | ctx.load_directory(argv[1]); | |
21 | ||
[4e426c9] | 22 | bool success; |
[9dffbd6] | 23 | vector<Credential> credentials = ctx.query( |
[64fa9ba] | 24 | "3f1aca4c5911b345d81c5f1a77675dce13249d0c.fed_create", |
[4e426c9] | 25 | "5839d714b16bbe108642c5eb586c2173420bed19", |
26 | success | |
[64fa9ba] | 27 | ); |
28 | ||
[4e426c9] | 29 | if (success) |
30 | puts("success"); | |
[9dffbd6] | 31 | for (vector<Credential>::iterator i = credentials.begin(); i != credentials.end(); ++i) { |
[64fa9ba] | 32 | printf("credential %s <- %s\n", |
[2af3b82] | 33 | i->head().string(), |
34 | i->tail().string() | |
[64fa9ba] | 35 | ); |
36 | } | |
37 | ||
38 | libabac_deinit(); | |
39 | ||
40 | return 0; | |
41 | } |
Note: See TracBrowser
for help on using the repository browser.