source: examples/example_scripts/c/tchunk.c @ 4721618

abac0-leakabac0-meimei-idmei-rt0-nmei_rt0tvf-new-xml
Last change on this file since 4721618 was 4721618, checked in by Mei <mei@…>, 11 years ago

1) tested out python and perl test scripts along with

abac_chunk_t calls in libabac's abac.hh

  • Property mode set to 100644
File size: 1002 bytes
Line 
1/**
2CAN NOT RUN
3   tchunk.c
4   chunking test, no ready yet
5
6**/
7
8#include <err.h>
9#include <stdio.h>
10#include <assert.h>
11
12#include <abac.h>
13
14extern void abac_print_cred_info(abac_credential_t*, FILE*);
15extern char *abac_id_keyid(abac_id_t *id);
16extern abac_attribute_t *abac_attribute_add_tail(abac_attribute_t *ptr, abac_aspect_t *);
17
18int main(int argc, char **argv) {
19    int i, success=0;
20    abac_credential_t *cred=NULL;
21    abac_credential_t **credentials=NULL;
22
23    abac_context_t *ctx = abac_context_new();
24
25    if(argc != 4) return 1;
26
27    /* build up structure */
28    abac_id_t *id =NULL;
29    id = abac_id_from_file(argv[2]);
30    int rc=abac_id_privkey_from_file(id,argv[3]);
31
32    int w=atoi(argv[1]);
33    if(w==0) {
34        printf("USING chunk...\n");
35        rc=abac_context_load_id_chunk(ctx, abac_id_cert_chunk(id));
36    } else {
37        printf("USING NO chunk...\n");
38/* no implemented
39        rc=abac_context_load_id_id(ctx, id); 
40*/
41    }
42    abac_context_free(ctx);
43    return 0;
44}
Note: See TracBrowser for help on using the repository browser.