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
|
Line | |
---|
1 | import java.io.*; |
---|
2 | import java.util.*; |
---|
3 | |
---|
4 | import edu.uci.ics.jung.graph.*; |
---|
5 | |
---|
6 | import net.deterlab.abac.Credential; |
---|
7 | import net.deterlab.abac.GENICredential; |
---|
8 | import net.deterlab.abac.Context; |
---|
9 | import net.deterlab.abac.Role; |
---|
10 | import net.deterlab.abac.Identity; |
---|
11 | |
---|
12 | import 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 | */ |
---|
19 | public 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.