source: java/net/deterlab/abac/Credential.java @ 31b67d5

abac0-leakabac0-meicompt_changesgec13mei-idmei-rt0-nmei_rt0mei_rt2mei_rt2_fix_1meiyap-rt1meiyap1rt2tvf-new-xml
Last change on this file since 31b67d5 was 31b67d5, checked in by Mike Ryan <mikeryan@…>, 13 years ago

initial basic implementation of native java ABAC library
credentials must be loaded from text, there is no crypto
no support for intersections
this code was lifted from crudge, the credential visualizer

  • Property mode set to 100644
File size: 827 bytes
Line 
1package net.deterlab.abac;
2
3public class Credential {
4    /**
5     * Create a credential from a head and tail role. This is only for testing.
6     * In a real implementation the Credential must be loaded from an X.509
7     * attribute cert.
8     */
9    public Credential(Role head, Role tail) {
10        m_head = head;
11        m_tail = tail;
12    }
13
14    /**
15     * Get the head role from the credential.
16     */
17    public Role head() {
18        return m_head;
19    }
20
21    /**
22     * Get the tail role from the credential
23     */
24    public Role tail() {
25        return m_tail;
26    }
27
28    /**
29     * Turn the credential into string form. The format is head &lt;- tail. For
30     * example: A.r1 &lt;- B.r2.r3.
31     */
32    public String toString() {
33        return m_head + " <- " + m_tail;
34    }
35
36    private Role m_head, m_tail;
37}
Note: See TracBrowser for help on using the repository browser.