mei_rt2mei_rt2_fix_1meiyap-rt1rt2
Last change
on this file since a9494ad was
202a7f9,
checked in by Mei <mei@…>, 12 years ago
|
commited modified files for rt1
|
-
Property mode set to
100644
|
File size:
857 bytes
|
Line | |
---|
1 | |
---|
2 | #include <err.h> |
---|
3 | #include <stdio.h> |
---|
4 | |
---|
5 | |
---|
6 | #include <abac_pl.h> |
---|
7 | |
---|
8 | #include "options.h" |
---|
9 | |
---|
10 | extern void abac_print_cred_info(abac_credential_t *); |
---|
11 | |
---|
12 | int main(int argc, char **argv) { |
---|
13 | int i, success; |
---|
14 | abac_credential_t *cred; |
---|
15 | |
---|
16 | options_t opts = { 0, }; |
---|
17 | get_options(argc, argv, &opts); |
---|
18 | abac_context_t *ctx = abac_context_new(); |
---|
19 | abac_context_load_directory(ctx, opts.keystore); |
---|
20 | abac_credential_t **credentials = abac_context_query(ctx, |
---|
21 | opts.role, opts.principal, |
---|
22 | &success |
---|
23 | ); |
---|
24 | if (success) |
---|
25 | puts("prover success!!"); |
---|
26 | |
---|
27 | if (credentials != NULL) |
---|
28 | puts("credentials needed :"); |
---|
29 | for (i = 0; credentials[i] != NULL; ++i) { |
---|
30 | cred = credentials[i]; |
---|
31 | abac_print_cred_info(cred); |
---|
32 | } |
---|
33 | |
---|
34 | abac_context_credentials_free(credentials); |
---|
35 | abac_context_free(ctx); |
---|
36 | |
---|
37 | return 0; |
---|
38 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.