|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.directory.shared.asn1.AbstractAsn1Object
org.apache.directory.shared.kerberos.components.PrincipalName
public class PrincipalName
A principal Name, composed of a type and N names.
PrincipalName ::= SEQUENCE {
name-type [0] Int32,
name-string [1] SEQUENCE OF KerberosString
}
| Constructor Summary | |
|---|---|
PrincipalName()
Creates a new empty instance of PrincipalName. |
|
PrincipalName(KerberosPrincipal principal)
Creates a new instance of PrincipalName, given a KerberosPrincipal. |
|
PrincipalName(String nameString,
int nameType)
Creates a new instance of PrincipalName. |
|
PrincipalName(String nameString,
PrincipalNameType nameType)
Creates a new instance of PrincipalName given a String and an prinipal type. |
|
| Method Summary | |
|---|---|
void |
addName(String name)
Add a new name to the PrincipalName |
int |
computeLength()
Compute the PrincipalName length |
ByteBuffer |
encode(ByteBuffer buffer)
Encode the PrincipalName message to a PDU. |
boolean |
equals(Object obj)
|
List<String> |
getNames()
Returns the name components. |
String |
getNameString()
|
PrincipalNameType |
getNameType()
Returns the type of the PrincipalName. |
int |
hashCode()
|
void |
setNameType(int nameType)
Set the Principal name Type |
void |
setNameType(PrincipalNameType nameType)
Set the Principal name Type |
String |
toString()
|
| Methods inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object |
|---|
addLength, getCurrentLength, getExpectedLength, getParent, getTlvId, setCurrentLength, setExpectedLength, setParent |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PrincipalName()
public PrincipalName(KerberosPrincipal principal)
principal - A Sun kerberosPrincipal instance
public PrincipalName(String nameString,
PrincipalNameType nameType)
throws ParseException
nameString - The name string, which can contains more than one nameComponentnameType - The principal name
ParseException
public PrincipalName(String nameString,
int nameType)
nameString - nameType - | Method Detail |
|---|
public PrincipalNameType getNameType()
PrincipalName.
PrincipalName.public void setNameType(PrincipalNameType nameType)
nameType - the Principal name Typepublic void setNameType(int nameType)
nameType - the Principal name Typepublic List<String> getNames()
public String getNameString()
public void addName(String name)
name - The name to addpublic int computeLength()
PrincipalName :
0x30 L1 PrincipalName sequence
|
+--> 0xA1 L2 name-type tag
| |
| +--> 0x02 L2-1 addressType (int)
|
+--> 0xA2 L3 name-string tag
|
+--> 0x30 L3-1 name-string (SEQUENCE OF KerberosString)
|
+--> 0x1B L4[1] value (KerberosString)
|
+--> 0x1B L4[2] value (KerberosString)
|
...
|
+--> 0x1B L4[n] value (KerberosString)
public ByteBuffer encode(ByteBuffer buffer)
throws org.apache.directory.shared.asn1.EncoderException
PrincipalName :
0x30 LL
0xA0 LL
0x02 0x01 name-type (integer)
0xA1 LL
0x30 LL name-string (SEQUENCE OF KerberosString)
0x1B LL name-string[1]
0x1B LL name-string[2]
...
0x1B LL name-string[n]
encode in interface org.apache.directory.shared.asn1.Asn1Objectencode in class org.apache.directory.shared.asn1.AbstractAsn1Objectbuffer - The buffer where to put the PDU. It should have been allocated
before, with the right size.
org.apache.directory.shared.asn1.EncoderExceptionpublic String toString()
toString in class ObjectObject.toString()public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||