source: tests/example_scripts/c/tchunk.c @ f2622ee

abac0-leak
Last change on this file since f2622ee was ec550f7, checked in by Mei <mei@…>, 11 years ago

1) reworked how API doc is generated
2) tweak top level Makefile.am
3) loading issuer principal as side-effect of loading

an attribute credentials

4) add examples of GENI specific attribute credentials

and principal certificates into the regression testing

5) rename examples to tests

  • Property mode set to 100644
File size: 795 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
14int main(int argc, char **argv) {
15    int rc;
16
17    abac_context_t *ctx = abac_context_new();
18
19    if(argc != 4) return 1;
20
21    /* build up structure */
22    abac_id_t *id =NULL;
23    id = abac_id_from_file(argv[2]);
24/*
25    int rc=abac_id_privkey_from_file(id,argv[3]);
26*/
27
28    int w=atoi(argv[1]);
29    if(w==0) {
30        printf("USING chunk...\n");
31        abac_id_t *nid=abac_id_from_chunk(abac_id_cert_chunk(id));
32        rc=abac_context_load_id_chunk(ctx, abac_id_cert_chunk(nid));
33    } else {
34        printf("USING NO chunk...\n");
35/* no implemented
36        rc=abac_context_load_id_id(ctx, id); 
37*/
38    }
39    abac_context_free(ctx);
40    return 0;
41}
Note: See TracBrowser for help on using the repository browser.