source: examples/example_scripts/c/tchunk.c @ 163aadf

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

1) add some strcpy for keyid assignments in abac_id

  • 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.