org.apache.directory.server.kerberos.shared.messages.value
Class PaData

java.lang.Object
  extended by org.apache.directory.shared.asn1.AbstractAsn1Object
      extended by org.apache.directory.server.kerberos.shared.messages.value.PaData
All Implemented Interfaces:
org.apache.directory.shared.asn1.Asn1Object

public class PaData
extends org.apache.directory.shared.asn1.AbstractAsn1Object

The Pre-Authentication data. Tha ASN.1 GRAMMAR IS : PA-DATA ::= SEQUENCE { -- NOTE: first tag is [1], not [0] padata-type [1] Int32, padata-value [2] OCTET STRING -- might be encoded AP-REQ }

Version:
$Rev: 642496 $, $Date: 2008-03-29 04:09:22 +0100 (Sa, 29 M??r 2008) $
Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object
parent
 
Constructor Summary
PaData()
          Creates a new instance of PreAuthenticationData.
PaData(PaDataType paDataType, byte[] paDataValue)
          Creates a new instance of PreAuthenticationData.
 
Method Summary
 int computeLength()
          Compute the PreAuthenticationData length 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)
 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)
           
 
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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PaData

public PaData()
Creates a new instance of PreAuthenticationData.


PaData

public PaData(PaDataType paDataType,
              byte[] paDataValue)
Creates a new instance of PreAuthenticationData.

Parameters:
paDataType -
paDataValue -
Method Detail

getPaDataType

public PaDataType getPaDataType()
Returns the PaDataType.

Returns:
The PaDataType.

setPaDataType

public void setPaDataType(int paDataType)
Set the PA-DATA type

Parameters:
paDataType - The PA-DATA type

setPaDataType

public void setPaDataType(PaDataType paDataType)
Set the PA-DATA type

Parameters:
paDataType - The PA-DATA type

getPaDataValue

public byte[] getPaDataValue()
Returns the raw bytes of the PaData.

Returns:
The raw bytes of the PaData.

setPaDataValue

public void setPaDataValue(byte[] paDataValue)
Set the PA-DATA value

Parameters:
paDataValue - The PA-DATA value

computeLength

public int computeLength()
Compute the PreAuthenticationData length 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)

Specified by:
computeLength in interface org.apache.directory.shared.asn1.Asn1Object
Specified by:
computeLength in class org.apache.directory.shared.asn1.AbstractAsn1Object

encode

public java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
                           throws org.apache.directory.shared.asn1.codec.EncoderException
Encode the PreAuthenticationData message to a PDU. PreAuthenticationData : 0x30 LL 0xA0 LL 0x02 0x01 padata-type 0xA1 LL 0x04 LL padata-value

Specified by:
encode in interface org.apache.directory.shared.asn1.Asn1Object
Overrides:
encode in class org.apache.directory.shared.asn1.AbstractAsn1Object
Parameters:
buffer - The buffer where to put the PDU. It should have been allocated before, with the right size.
Returns:
The constructed PDU.
Throws:
org.apache.directory.shared.asn1.codec.EncoderException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

toString

public java.lang.String toString(java.lang.String tabs)
See Also:
Object.toString()


Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.