org.apache.directory.shared.kerberos.components
Class ETypeInfoEntry

java.lang.Object
  extended by org.apache.directory.shared.asn1.AbstractAsn1Object
      extended by org.apache.directory.shared.kerberos.components.ETypeInfoEntry
All Implemented Interfaces:
org.apache.directory.shared.asn1.Asn1Object

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

Provides encryption info information sent to the client. The ASN.1 grammar for this structure is :

 ETYPE-INFO-ENTRY        ::= SEQUENCE {
            etype           [0] Int32,
            salt            [1] OCTET STRING OPTIONAL
    }
 

Author:
Apache Directory Project

Constructor Summary
ETypeInfoEntry()
          Creates a new instance of ETypeInfoEntry.
ETypeInfoEntry(EncryptionType etype, byte[] salt)
          Creates a new instance of ETypeInfoEntry.
 
Method Summary
 int computeLength()
          Compute the ETYPE-INFO-ENTRY length
 ByteBuffer encode(ByteBuffer buffer)
          Encode the ETYPE-INFO-ENTRY message to a PDU.
 EncryptionType getEType()
          Returns the EncryptionType.
 byte[] getSalt()
          Returns the salt.
 void setEType(EncryptionType etype)
           
 void setSalt(byte[] salt)
           
 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

ETypeInfoEntry

public ETypeInfoEntry(EncryptionType etype,
                      byte[] salt)
Creates a new instance of ETypeInfoEntry.

Parameters:
etype - the Encryption type
salt - the salt

ETypeInfoEntry

public ETypeInfoEntry()
Creates a new instance of ETypeInfoEntry.

Method Detail

getSalt

public byte[] getSalt()
Returns the salt.

Returns:
The salt.

setSalt

public void setSalt(byte[] salt)
Parameters:
salt - the salt to set

getEType

public EncryptionType getEType()
Returns the EncryptionType.

Returns:
The EncryptionType.

setEType

public void setEType(EncryptionType etype)
Parameters:
encryptionType - the encryptionType to set

computeLength

public int computeLength()
Compute the ETYPE-INFO-ENTRY length
 ETYPE-INFO-ENTRY :
 
 0x30 L1 ETYPE-INFO-ENTRY sequence
  |
  +--> 0xA0 L2 etype tag
  |     |
  |     +--> 0x02 L2-1etype (int)
  |
  +--> 0xA1 L3 salt tag
        |
        +--> 0x04 L3-1 salt (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) 
  


encode

public ByteBuffer encode(ByteBuffer buffer)
                  throws org.apache.directory.shared.asn1.EncoderException
Encode the ETYPE-INFO-ENTRY message to a PDU.
 ETYPE-INFO-ENTRY :
 
 0x30 LL
   0xA1 LL 
     0x02 0x01 etype
   0xA2 LL 
     0x04 LL salt
 

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.EncoderException

toString

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


Copyright © 2003-2012 The Apache Software Foundation. All Rights Reserved.