source: swig/perl/prover.pl @ 02888af

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

add swig

  • Property mode set to 100755
File size: 603 bytes
Line 
1#!/usr/bin/perl
2
3use strict;
4use ABAC;
5use Data::Dumper;
6$Data::Dumper::Indent = 1;
7
8my $keystore = shift || die "Usage: prover.pl <keystore>\n";
9
10ABAC::libabac_init();
11
12my $ctx = ABAC::Context->new;
13$ctx->load_directory($keystore);
14
15my ($success, $credentials) = $ctx->query(
16    "3f1aca4c5911b345d81c5f1a77675dce13249d0c.fed_create",
17    "5839d714b16bbe108642c5eb586c2173420bed19"
18);
19
20if ($success) {
21    print "Success\n";
22}
23
24foreach my $credential (@$credentials) {
25    printf "credential %s <- %s\n",
26        $credential->head->string,
27        $credential->tail->string;
28}
29
30ABAC::libabac_deinit();
Note: See TracBrowser for help on using the repository browser.