Changeset d69593c


Ignore:
Timestamp:
Mar 25, 2011 10:46:55 AM (8 years ago)
Author:
Ted Faber <faber@…>
Branches:
abac0-leak, abac0-mei, compt_changes, gec13, master, mei-id, mei-rt0-n, mei_rt0, mei_rt2, mei_rt2_fix_1, meiyap-rt1, meiyap1, rt2, tvf-new-xml
Children:
5129e3e
Parents:
f25a7ff
Message:

Compatibility additions.

Location:
java
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • java/GraphTest.java

    r1a80501 rd69593c  
    6666            if ( c.hasCertificate()) {
    6767                c.write(fn + n++ + suf);
    68                 ids.add(c.getID());
     68                ids.add(c.issuer());
    6969            }
    7070        }
  • java/net/deterlab/abac/Context.java

    rf25a7ff rd69593c  
    592592            c.write(z);
    593593            z.closeEntry();
    594             if ( c.getID() != null && !allIDs) ids.add(c.getID());
     594            if ( c.issuer() != null && !allIDs) ids.add(c.issuer());
    595595        }
    596596        for (Identity i: ids) {
  • java/net/deterlab/abac/Credential.java

    r0595372 rd69593c  
    2626    protected static String authKeyOID = "2.5.29.35";
    2727
    28     private Role m_head;
    29     private Role m_tail;
    30     private X509V2AttributeCertificate ac;
    31     private Identity id;
     28    protected Role m_head;
     29    protected Role m_tail;
     30    protected X509V2AttributeCertificate ac;
     31    protected Identity id;
    3232
    3333    /**
     
    8585        load_roles();
    8686
    87         if (!id.getKeyID().equals(m_head.issuer_part()))
     87        if (!id.getKeyID().equals(m_head.principal()))
    8888            throw new InvalidKeyException("Unknown identity");
    8989    }
     
    127127
    128128        gen.setIssuer(new AttributeCertificateIssuer(
    129                     new X509Principal("CN="+m_head.issuer_part())));
     129                    new X509Principal("CN="+m_head.principal())));
    130130        gen.setHolder(new AttributeCertificateHolder(
    131                     new X509Principal("CN="+m_head.issuer_part())));
     131                    new X509Principal("CN="+m_head.principal())));
    132132        gen.setNotAfter(new Date(System.currentTimeMillis()
    133133                    + 3600 * 1000 * 24 * 365));
     
    241241    public boolean hasCertificate() { return ac != null; }
    242242
    243     public Identity getID() { return id; }
     243    public Identity issuer() { return id; }
     244    public X509Certificate issuerCert() { return id.getCertificate(); }
     245    public X509V2AttributeCertificate attributeCert() { return ac; }
    244246
    245247
  • java/net/deterlab/abac/Role.java

    r53f5c27 rd69593c  
    99 */
    1010public class Role implements Comparable {
    11     private String m_string;
    12     private String[] m_parts;
    13     private String m_A_r1, m_r2;
    14     private String m_prefix;
    15     private Role[] m_prereqs;
     11    protected String m_string;
     12    protected String[] m_parts;
     13    protected String m_A_r1;
     14    protected String m_r2;
     15    protected String m_prefix;
     16    protected Role[] m_prereqs;
    1617
    1718    /**
     
    5051    public Role(String s, Context c) {
    5152        this(c.expandKeyID(s));
     53    }
     54
     55    public Role(Role r) {
     56        m_string = r.m_string;
     57        m_A_r1 = r.m_A_r1;
     58        m_r2 = r.m_r2;
     59        m_prefix = r.m_prefix;
     60        m_parts = new String[r.m_parts.length];
     61        for (int i = 0; i < r.m_parts.length; i++)
     62            m_parts[i] = r.m_parts[i];
     63        m_prereqs = new Role[m_prereqs.length];
     64        for (int i = 0; i < r.m_prereqs.length; i++)
     65            m_prereqs[i] = new Role(r.m_prereqs[i]);
    5266    }
    5367
     
    126140    }
    127141
    128     /**
    129      * Returns an issuer, only the first element.
    130      */
    131     public String issuer_part() { return m_parts[0]; }
     142    public String principal() { return m_parts.length > 0 ? m_parts[0] : null; }
     143    public String role_name() { return m_parts.length > 1 ? m_parts[1] : null; }
     144    public String linked_role() { return A_r1(); }
    132145
    133146    /**
Note: See TracChangeset for help on using the changeset viewer.