source: examples/example_scripts/java/tchunk.java @ 97a6a36

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

1) added java to libabac using swig
2) added java examples (setup/prover) into regression test suites
(note. still have that libstrongswan/src/threading/threads.c/thread_deinit()
problem when using using libabac with java)

  • Property mode set to 100644
File size: 885 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        System.out.println("called main from tchunk.java");
40
41    }
42}
43
Note: See TracBrowser for help on using the repository browser.