1 | package net.deterlab.abac; |
---|
2 | |
---|
3 | import java.io.*; |
---|
4 | import 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.5 |
---|
14 | */ |
---|
15 | public 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 | } |
---|