source: examples/example_scripts/java/tchunk.java @ 20eaefe

mei_rt2mei_rt2_fix_1
Last change on this file since 20eaefe was e3c7769, checked in by Mei <mei@…>, 12 years ago

1) wrap up java interface with swig/jni/abac linkup
2) java regression tests
3) update doc related to new java implmentation

  • Property mode set to 100644
File size: 918 bytes
Line 
1/*****
2     tchunk.java
3***/
4
5import java.io.*;
6import java.util.*;
7
8import net.deterlab.abac.*;
9
10public class tchunk {
11
12    static {
13        System.loadLibrary("jABAC");
14    }
15
16    public static void main(String[] args) throws IOException {
17
18        String w=args[0];
19        String icecreamID=args[1];
20        String icecreamKEY=args[2];
21
22        Context ctxt=new Context();
23
24        ID id=new ID(icecreamID);
25        id.id_load_privkey_file(icecreamKEY);
26
27        ctxt.load_id(id);
28        if(w.equals("0")) {
29            System.out.println("USING chunk...");
30            ctxt.load_id_chunks(id.id_cert_chunk(), id.id_privkey_chunk());
31        } else {
32            System.out.println("USING NO chunk...");
33            ctxt.load_id(id);
34        }
35
36        /* what is in prolog db */
37        ctxt.dump_yap_db(); 
38
39        ctxt.free_context_now();
40        System.out.println("called main from tchunk.java");
41
42    }
43}
44
Note: See TracBrowser for help on using the repository browser.