mei_rt2mei_rt2_fix_1meiyap-rt1rt2
Last change
on this file since 202a7f9 was
202a7f9,
checked in by Mei <mei@…>, 12 years ago
|
commited modified files for rt1
|
-
Property mode set to
100644
|
File size:
857 bytes
|
Rev | Line | |
---|
[e95d652] | 1 | |
---|
| 2 | #include <err.h> |
---|
| 3 | #include <stdio.h> |
---|
| 4 | |
---|
[202a7f9] | 5 | |
---|
[e95d652] | 6 | #include <abac_pl.h> |
---|
| 7 | |
---|
| 8 | #include "options.h" |
---|
| 9 | |
---|
[202a7f9] | 10 | extern void abac_print_cred_info(abac_credential_t *); |
---|
| 11 | |
---|
[e95d652] | 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]; |
---|
[202a7f9] | 31 | abac_print_cred_info(cred); |
---|
[e95d652] | 32 | } |
---|
| 33 | |
---|
[202a7f9] | 34 | abac_context_credentials_free(credentials); |
---|
[e95d652] | 35 | abac_context_free(ctx); |
---|
| 36 | |
---|
| 37 | return 0; |
---|
| 38 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.