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

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

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

A single AuthorizationData The ASN.1 grammar is : -- NOTE: AuthorizationData is always used as an OPTIONAL field and -- should not be empty. AuthorizationDataEntry ::= SEQUENCE { ad-type [0] Int32, ad-data [1] OCTET STRING }

Version:
$Rev: 902575 $, $Date: 2010-01-24 15:38:06 +0100 (Sun, 24 Jan 2010) $
Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object
parent
 
Constructor Summary
AuthorizationDataEntry()
          Creates a new instance of AuthorizationDataEntry.
AuthorizationDataEntry(AuthorizationType adType, byte[] adData)
          Creates a new instance of AuthorizationDataEntry.
 
Method Summary
 int computeLength()
          Compute the AuthorizationDataEntry length AuthorizationDataEntry : 0x30 L1 AuthorizationDataEntry | +--> 0xA0 L2 adType tag | | | +--> 0x02 L2-1 adType (int) | +--> 0xA1 L3 adData tag | +--> 0x04 L3-1 adData (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 AuthorizationDataEntry message to a PDU.
 byte[] getAdData()
          Returns the raw bytes of the authorization data.
 AuthorizationType getAdType()
          Returns the AuthorizationType.
 void setAdData(byte[] adData)
          Set the authorization data
 void setAdType(AuthorizationType adType)
          Set the authorization type
 void setAdType(int adType)
          Set the authorization type
 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

AuthorizationDataEntry

public AuthorizationDataEntry()
Creates a new instance of AuthorizationDataEntry.


AuthorizationDataEntry

public AuthorizationDataEntry(AuthorizationType adType,
                              byte[] adData)
Creates a new instance of AuthorizationDataEntry.

Parameters:
adType - The authorizationType
adData - The authorization data
Method Detail

getAdData

public byte[] getAdData()
Returns the raw bytes of the authorization data.

Returns:
The raw bytes of the authorization data.

setAdData

public void setAdData(byte[] adData)
Set the authorization data

Parameters:
adData - The data

getAdType

public AuthorizationType getAdType()
Returns the AuthorizationType.

Returns:
The AuthorizationType.

setAdType

public void setAdType(int adType)
Set the authorization type

Parameters:
adType - The authorization type

setAdType

public void setAdType(AuthorizationType adType)
Set the authorization type

Parameters:
adType - The authorization type

computeLength

public int computeLength()
Compute the AuthorizationDataEntry length AuthorizationDataEntry : 0x30 L1 AuthorizationDataEntry | +--> 0xA0 L2 adType tag | | | +--> 0x02 L2-1 adType (int) | +--> 0xA1 L3 adData tag | +--> 0x04 L3-1 adData (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 AuthorizationDataEntry message to a PDU. AuthorizationDataEntry : 0x30 LL 0xA0 LL 0x02 0x01 adType 0xA1 LL 0x04 LL adData

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-2011 Apache Software Foundation. All Rights Reserved.