public class PrincipalName extends Object implements org.apache.directory.api.asn1.Asn1Object
PrincipalName ::= SEQUENCE { name-type [0] Int32, name-string [1] SEQUENCE OF KerberosString }
Constructor and Description |
---|
PrincipalName()
Creates a new empty instance of PrincipalName.
|
Modifier and Type | Method and Description |
---|---|
void |
addName(String name)
Add a new name to the PrincipalName
|
int |
computeLength()
Compute the PrincipalName length
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)
|
|
ByteBuffer |
encode(ByteBuffer buffer)
Encode the PrincipalName message to a PDU.
|
boolean |
equals(Object obj) |
String |
getNameString() |
PrincipalNameType |
getNameType()
Returns the type of the
PrincipalName . |
int |
hashCode() |
void |
setNameType(PrincipalNameType nameType)
Set the Principal name Type
|
String |
toString() |
public PrincipalName()
public PrincipalNameType getNameType()
PrincipalName
.PrincipalName
.public void setNameType(PrincipalNameType nameType)
nameType
- the Principal name Typepublic 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)
computeLength
in interface org.apache.directory.api.asn1.Asn1Object
public ByteBuffer encode(ByteBuffer buffer) throws org.apache.directory.api.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.api.asn1.Asn1Object
buffer
- The buffer where to put the PDU. It should have been allocated
before, with the right size.org.apache.directory.api.asn1.EncoderException
public String toString()
toString
in class Object
Object.toString()
Copyright © 2003–2023 The Apache Software Foundation. All rights reserved.