source: java/net/deterlab/abac/CredentialFactorySpecialization.java @ 6cd69a0

abac0-leakabac0-mei
Last change on this file since 6cd69a0 was 79f516b, checked in by Ted Faber <faber@…>, 12 years ago

Properly read nicknames from creds

  • Property mode set to 100644
File size: 1.5 KB
Line 
1package net.deterlab.abac;
2
3import java.io.*;
4import java.util.*;
5
6/**
7 * This class parses or generates credentials.  The parser produces one or more
8 * Credentials.  The generator produces exactly one credential. Each class that
9 * wants to be parsed and generated needs to export a static method that
10 * returns one of these.  For credentials that parse 1 credential to 1 input it
11 * will be a wrapper around a constructor.
12 * @author <a href="http://abac.deterlab.net">ISI ABAC team</a>
13 * @version 1.4
14 */
15public abstract class CredentialFactorySpecialization {
16    /**
17     * Parse one or more Credentials from the given input and IDs.  The
18     * sub-type of Credential returned is up to this class.
19     * @param is an InputStream to be parsed
20     * @param ids a Collection of Identity s to use in validating credentials.
21     * @return an array of Credentials
22     * @throws ABACException on parsing problems
23     */
24    public abstract Credential[] parseCredential(InputStream is, 
25            Collection<Identity> ids) throws ABACException;
26
27    /**
28     * Return an object derived from a credential with the given roles.
29     * @param head a Role, the head of the encoded ABAC statement
30     * @param tail a Role, the tail of the decoded ABAC statement
31     * @param aliases a KeyIDMap containing aliases for keyids
32     * @return a Credential encoding that ABAC statement
33     */
34    public abstract Credential generateCredential(Role head, Role tail, 
35            KeyIDMap aliases);
36}
Note: See TracBrowser for help on using the repository browser.