source: libabac/prover.cc @ 15200be

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

move libabac into its own directory

  • Property mode set to 100644
File size: 890 bytes
Line 
1#include <err.h>
2#include <stdio.h>
3#include <vector>
4
5#include "abac.hh"
6#include "abac_util.h"
7
8using namespace ABAC;
9using std::vector;
10
11int main(int argc, char **argv) {
12    int i;
13    abac_credential_t *cred;
14
15    if (argc < 2)
16        errx(1, "Usage: %s <keystore>", argv[0]);
17
18    libabac_init();
19
20    Context ctx;
21    ctx.load_directory(argv[1]);
22
23    debug_printf("querying\n");
24
25    bool success;
26    vector<Credential> credentials = ctx.query(
27        "3f1aca4c5911b345d81c5f1a77675dce13249d0c.fed_create",
28        "5839d714b16bbe108642c5eb586c2173420bed19",
29        success
30    );
31
32    if (success)
33        puts("success");
34    for (vector<Credential>::iterator i = credentials.begin(); i != credentials.end(); ++i) {
35        printf("credential %s <- %s\n",
36            i->head().string(),
37            i->tail().string()
38        );
39    }
40
41    libabac_deinit();
42
43    return 0;
44}
Note: See TracBrowser for help on using the repository browser.