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

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

1) add some strcpy for keyid assignments in abac_id

  • Property mode set to 100644
File size: 795 bytes
RevLine 
[4721618]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) {
[c0fd8bc]15    int rc;
[4721618]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]);
[c0fd8bc]24/*
[4721618]25    int rc=abac_id_privkey_from_file(id,argv[3]);
[c0fd8bc]26*/
[4721618]27
28    int w=atoi(argv[1]);
29    if(w==0) {
30        printf("USING chunk...\n");
[c0fd8bc]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));
[4721618]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.