source: java/net/deterlab/abac/CredentialFactory.java @ 797bebe

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

checkpoint

  • Property mode set to 100644
File size: 883 bytes
Line 
1package net.deterlab.abac;
2
3import java.io.*;
4
5import java.util.*;
6
7
8/**
9 * XXX:
10 * An ABAC credential, with or without an underlying certificate that
11 * represents it.  These are edges in proof graphs and can be constructed from
12 * their constituent Roles.
13 * @author <a href="http://abac.deterlab.net">ISI ABAC team</a>
14 * @version 1.3
15 */
16public class CredentialFactory {
17    // XXX register and extend
18    static Credential[] newInstance(File fn, Set<Identity> ids) {
19        Credential rv = null;
20        try {
21            rv = new X509Credential(fn, ids);
22        }
23        catch (Exception e ) {
24            rv = null;
25        }
26        try {
27            rv = new GENICredential(fn, ids);
28        }
29        catch (Exception e ) {
30            rv = null;
31        }
32        if ( rv != null ) 
33            return new Credential[] { rv };
34        else 
35            return null;
36    }
37    static Credential[] newInstance(String fn, Set<Identity> ids) {
38        return newInstance(new File(fn), ids);
39    }
40}
Note: See TracBrowser for help on using the repository browser.