issrg.pba.rbac
Class LDAPDNPrincipal

java.lang.Object
  extended by issrg.pba.rbac.LDAPDNPrincipal
All Implemented Interfaces:
java.security.Principal
Direct Known Subclasses:
DNWithURLPrincipal

public class LDAPDNPrincipal
extends java.lang.Object
implements java.security.Principal

This class represents a Principal whose name is an LDAP DN corresponding to RFC2253.

Version:
1.0
Author:
A Otenko

Field Summary
static LDAPDNPrincipal WHOLE_WORLD_DN
           
 
Constructor Summary
protected LDAPDNPrincipal()
           
  LDAPDNPrincipal(java.lang.String ldapDN)
          This constructor builds the object out of the String representation of the DN.
 
Method Summary
 boolean equals(java.lang.Object o)
          This method defines the equality comparison of the DNs.
 java.lang.String getName()
          This method returns the canonical representation of the Principal's DN, which may differ from the value you input to the constructor, but with equivalent meaning in terms of RFC2253.
 java.lang.String[][][] getParsedDN()
          Returns the DN as an array, specified by issrg.utils.RFC2253Parser
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.security.Principal
hashCode, toString
 

Field Detail

WHOLE_WORLD_DN

public static final LDAPDNPrincipal WHOLE_WORLD_DN
Constructor Detail

LDAPDNPrincipal

protected LDAPDNPrincipal()

LDAPDNPrincipal

public LDAPDNPrincipal(java.lang.String ldapDN)
                throws RFC2253ParsingException
This constructor builds the object out of the String representation of the DN. It uses issrg.utils.RFC2253NameParser to check if the name can be successfully parsed. If not, an issrg.utils.RFC2253ParsingException is thrown.

Throws:
RFC2253ParsingException
See Also:
RFC2253NameParser, RFC2253ParsingException
Method Detail

getName

public java.lang.String getName()
This method returns the canonical representation of the Principal's DN, which may differ from the value you input to the constructor, but with equivalent meaning in terms of RFC2253.

Note that the issrg.utils.RFC2253NameParser does not have a registry of attribute names or OIDs, so it is not aware of what attribute values should be encoded as hexstrings (starting with '#'). After conversion of such values to the canonical representation there may be loss of comparison precision, if the values happen to contain US-ASCII characters, which will be compared as case-insensitive values, not as binary values.

Specified by:
getName in interface java.security.Principal
Returns:
the canonical representation of the DN.

getParsedDN

public java.lang.String[][][] getParsedDN()
Returns the DN as an array, specified by issrg.utils.RFC2253Parser

Returns:
an array of values representing the DN

equals

public boolean equals(java.lang.Object o)
This method defines the equality comparison of the DNs.

Specified by:
equals in interface java.security.Principal
Overrides:
equals in class java.lang.Object
Parameters:
o - is the object to compare
Returns:
true, if o is a Principal containing the DN equal to the one this object contains