abac0-leakabac0-meicompt_changesgec13mei-idmei-rt0-nmei_rt0mei_rt2mei_rt2_fix_1meiyap-rt1meiyap1rt2tvf-new-xml
Last change
on this file since 02888af was
6ede88c,
checked in by Mike Ryan <mikeryan@…>, 14 years ago
|
autoconf/make/libtoolize
|
-
Property mode set to
100644
|
File size:
834 bytes
|
Line | |
---|
1 | #include <err.h> |
---|
2 | #include <stdio.h> |
---|
3 | #include <vector> |
---|
4 | |
---|
5 | #include <abac.hh> |
---|
6 | |
---|
7 | using namespace ABAC; |
---|
8 | using std::vector; |
---|
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 | |
---|
22 | bool success; |
---|
23 | vector<Credential> credentials = ctx.query( |
---|
24 | "3f1aca4c5911b345d81c5f1a77675dce13249d0c.fed_create", |
---|
25 | "5839d714b16bbe108642c5eb586c2173420bed19", |
---|
26 | success |
---|
27 | ); |
---|
28 | |
---|
29 | if (success) |
---|
30 | puts("success"); |
---|
31 | for (vector<Credential>::iterator i = credentials.begin(); i != credentials.end(); ++i) { |
---|
32 | printf("credential %s <- %s\n", |
---|
33 | i->head().string(), |
---|
34 | i->tail().string() |
---|
35 | ); |
---|
36 | } |
---|
37 | |
---|
38 | libabac_deinit(); |
---|
39 | |
---|
40 | return 0; |
---|
41 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.