public class PaData
extends java.lang.Object
implements org.apache.directory.api.asn1.Asn1Object
PA-DATA ::= SEQUENCE {
-- NOTE: first tag is [1], not [0]
padata-type [1] Int32,
padata-value [2] OCTET STRING -- might be encoded AP-REQ
}
| Modifier and Type | Field and Description |
|---|---|
private static boolean |
IS_DEBUG
Speedup for logs
|
private static org.slf4j.Logger |
log
The logger
|
private PaDataType |
paDataType
The Pre-authentication type
|
private int |
paDataTypeTagLength |
private byte[] |
paDataValue
The authentication data
|
private int |
paDataValueTagLength |
private int |
preAuthenticationDataSeqLength |
| Constructor and Description |
|---|
PaData()
Creates a new instance of PreAuthenticationData.
|
PaData(PaDataType paDataType,
byte[] paDataValue)
Creates a new instance of PreAuthenticationData.
|
| Modifier and Type | Method and Description |
|---|---|
int |
computeLength()
Compute the PreAuthenticationData length
|
java.nio.ByteBuffer |
encode(java.nio.ByteBuffer buffer)
Encode the PreAuthenticationData message to a PDU.
|
PaDataType |
getPaDataType()
Returns the
PaDataType. |
byte[] |
getPaDataValue()
Returns the raw bytes of the
PaData. |
void |
setPaDataType(int paDataType)
Set the PA-DATA type
|
void |
setPaDataType(PaDataType paDataType)
Set the PA-DATA type
|
void |
setPaDataValue(byte[] paDataValue)
Set the PA-DATA value
|
java.lang.String |
toString() |
java.lang.String |
toString(java.lang.String tabs) |
private static final org.slf4j.Logger log
private static final boolean IS_DEBUG
private PaDataType paDataType
private byte[] paDataValue
private int paDataTypeTagLength
private int paDataValueTagLength
private int preAuthenticationDataSeqLength
public PaData()
public PaData(PaDataType paDataType, byte[] paDataValue)
paDataType - paDataValue - public PaDataType getPaDataType()
PaDataType.PaDataType.public void setPaDataType(int paDataType)
paDataType - The PA-DATA typepublic void setPaDataType(PaDataType paDataType)
paDataType - The PA-DATA typepublic byte[] getPaDataValue()
PaData.PaData.public void setPaDataValue(byte[] paDataValue)
paDataValue - The PA-DATA valuepublic int computeLength()
PreAuthenticationData :
0x30 L1 PreAuthenticationData sequence
|
+--> 0xA0 L2 padata-type tag
| |
| +--> 0x02 L2-1 padata-type (int)
|
+--> 0xA1 L3 padata-value tag
|
+--> 0x04 L3-1 padata-value (OCTET STRING)
where L1 = L2 + lenght(0xA0) + length(L2) +
L3 + lenght(0xA1) + length(L3)
and
L2 = L2-1 + length(0x02) + length( L2-1)
L3 = L3-1 + length(0x04) + length( L3-1)
computeLength in interface org.apache.directory.api.asn1.Asn1Objectpublic java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
throws org.apache.directory.api.asn1.EncoderException
PreAuthenticationData :
0x30 LL
0xA1 LL
0x02 0x01 padata-type
0xA2 LL
0x04 LL padata-value
encode in interface org.apache.directory.api.asn1.Asn1Objectbuffer - The buffer where to put the PDU. It should have been allocated
before, with the right size.org.apache.directory.api.asn1.EncoderExceptionpublic java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public java.lang.String toString(java.lang.String tabs)
Object.toString()