import java.io.*; import java.util.*; import edu.uci.ics.jung.graph.*; import net.deterlab.abac.Credential; import net.deterlab.abac.GENICredential; import net.deterlab.abac.Context; import net.deterlab.abac.Role; import net.deterlab.abac.Identity; import java.security.KeyPair; /** * Simple test of the native Java implementation of ABAC. Loads credentials * from an rt0 file and runs a query against them. */ public class Writer { public static void main(String[] args) throws IOException { if (args.length < 4) { System.out.println("Usage: Writer cert head tail output"); System.out.println(" Reads the files and prints the credentials"); System.exit(1); } try { Identity i = new Identity(new File(args[0])); Credential c = new GENICredential(new Role(args[1]), new Role(args[2])); System.out.println(c); c.make_cert(i); c.write(args[3]); } catch (Exception e) { e.printStackTrace(); } } }