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

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

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

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

 ETYPE-INFO2-ENTRY        ::= SEQUENCE {
            etype           [0] Int32,
            salt            [1] KerberosString OPTIONAL,
            s2kparams       [2] OCTET STRING OPTIONAL
    }
 

Author:
Apache Directory Project

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

ETypeInfo2Entry

public ETypeInfo2Entry()
Creates a new instance of ETypeInfo2Entry.

Method Detail

getSalt

public String getSalt()
Returns the salt.

Returns:
The salt.

setSalt

public void setSalt(String salt)
Parameters:
salt - the salt to set

getS2kparams

public byte[] getS2kparams()
Returns the s2kparams.

Returns:
The s2kparams.

setS2kparams

public void setS2kparams(byte[] s2kparams)
Parameters:
s2kparams - the s2kparams 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-INFO2-ENTRY length
 ETYPE-INFO-ENTRY :
 
 0x30 L1 ETYPE-INFO2-ENTRY sequence
  |
  +--> 0xA0 L2 etype tag
  |     |
  |     +--> 0x02 L2-1etype (int)
  |
  +--> 0xA1 L3 salt tag
  |     |
  |     +--> 0x1B L3-1 salt (KerberosString)
  |
  +--> 0xA2 L4 s2kparams tag
        |
        +--> 0x04 L4-1 salt (OCTET STRING)
        
  where L1 = L2 + length(0xA0) + length(L2) +
             L3 + length(0xA1) + length(L3) +
             L4 + length(0xA2) + length( L4)
  and
  L2 = L2-1 + length(0x02) + length( L2-1) 
  L3 = L3-1 + length(0x1B) + length( L3-1) 
  L4 = L4-1 + length(0x04) + length( L4-1) 
  


encode

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

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.