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

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

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

The TransitedEncoding structure. The ASN.1 grammar is : -- encoded Transited field TransitedEncoding ::= SEQUENCE { tr-type [0] Int32 -- must be registered --, contents [1] OCTET STRING }

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
TransitedEncoding()
          Creates a new instance of TransitedEncoding.
TransitedEncoding(TransitedEncodingType trType, byte[] contents)
          Creates a new instance of TransitedEncoding.
 
Method Summary
 int computeLength()
          Compute the TransitedEncoding length TransitedEncoding : 0x30 L1 TransitedEncoding | +--> 0xA0 L2 trType tag | | | +--> 0x02 L2-1 trType (int) | +--> 0xA1 L3 contents tag | +--> 0x04 L3-1 contents (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 TransitedEncoding message to a PDU.
 byte[] getContents()
          Returns the contents.
 TransitedEncodingType getTrType()
          Returns the TransitedEncodingType.
 void setContents(byte[] contents)
          Set the contents
 void setTrType(TransitedEncodingType trType)
          Set the transited encoding type
 java.lang.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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TransitedEncoding

public TransitedEncoding()
Creates a new instance of TransitedEncoding.


TransitedEncoding

public TransitedEncoding(TransitedEncodingType trType,
                         byte[] contents)
Creates a new instance of TransitedEncoding.

Parameters:
trType -
contents -
Method Detail

getContents

public byte[] getContents()
Returns the contents.

Returns:
The contents.

setContents

public void setContents(byte[] contents)
Set the contents

Parameters:
contents - The contents

getTrType

public TransitedEncodingType getTrType()
Returns the TransitedEncodingType.

Returns:
The TransitedEncodingType.

setTrType

public void setTrType(TransitedEncodingType trType)
Set the transited encoding type

Parameters:
trType - The transited encoding type

computeLength

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


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