source: java/Writer.java @ 8ee55e7

abac0-leakabac0-meimei-idmei-rt0-nmei_rt0tvf-new-xml
Last change on this file since 8ee55e7 was 797bebe, checked in by Ted Faber <faber@…>, 12 years ago

Add Writer & checkpoint

  • Property mode set to 100644
File size: 1006 bytes
RevLine 
[797bebe]1import java.io.*;
2import java.util.*;
3
4import edu.uci.ics.jung.graph.*;
5
6import net.deterlab.abac.Credential;
7import net.deterlab.abac.GENICredential;
8import net.deterlab.abac.Context;
9import net.deterlab.abac.Role;
10import net.deterlab.abac.Identity;
11
12import java.security.KeyPair;
13
14
15/**
16 * Simple test of the native Java implementation of ABAC. Loads credentials
17 * from an rt0 file and runs a query against them.
18 */
19public class Writer {
20    public static void main(String[] args) throws IOException {
21        if (args.length < 4) {
22            System.out.println("Usage: Writer cert head tail output");
23            System.out.println("   Reads the files and prints the credentials");
24            System.exit(1);
25        }
26
27        try {
28            Identity i = new Identity(new File(args[0]));
29            Credential c = new GENICredential(new Role(args[1]), 
30                    new Role(args[2]));
31
32            System.out.println(c);
33            c.make_cert(i);
34            c.write(args[3]);
35        }
36        catch (Exception e) {
37            e.printStackTrace();
38        }
39    }
40}
Note: See TracBrowser for help on using the repository browser.