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

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

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

Class representing KRB-SAFE-BODY message

 KRB-SAFE-BODY   ::= SEQUENCE {
         user-data       [0] OCTET STRING,
         timestamp       [1] KerberosTime OPTIONAL,
         usec            [2] Microseconds OPTIONAL,
         seq-number      [3] UInt32 OPTIONAL,
         s-address       [4] HostAddress,
         r-address       [5] HostAddress OPTIONAL
 }

Author:
Apache Directory Project

Constructor Summary
KrbSafeBody()
          Creates a new instance of KrbSafeBody.
 
Method Summary
 int computeLength()
          Compute the KRB-SAFE-BODY length:
 ByteBuffer encode(ByteBuffer buffer)
          
 HostAddress getRecipientAddress()
           
 HostAddress getSenderAddress()
           
 int getSeqNumber()
           
 KerberosTime getTimestamp()
           
 int getUsec()
           
 byte[] getUserData()
           
 void setRecipientAddress(HostAddress recipientAddress)
           
 void setSenderAddress(HostAddress senderAddress)
           
 void setSeqNumber(int seqNumber)
           
 void setTimestamp(KerberosTime timestamp)
           
 void setUsec(int usec)
           
 void setUserData(byte[] userData)
           
 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

KrbSafeBody

public KrbSafeBody()
Creates a new instance of KrbSafeBody.

Method Detail

getUserData

public byte[] getUserData()
Returns:
the userData

setUserData

public void setUserData(byte[] userData)
Parameters:
userData - the userData to set

getTimestamp

public KerberosTime getTimestamp()
Returns:
the timestamp

setTimestamp

public void setTimestamp(KerberosTime timestamp)
Parameters:
timestamp - the timestamp to set

getUsec

public int getUsec()
Returns:
the usec

setUsec

public void setUsec(int usec)
Parameters:
usec - the usec to set

getSeqNumber

public int getSeqNumber()
Returns:
the seqNumber

setSeqNumber

public void setSeqNumber(int seqNumber)
Parameters:
seqNumber - the seqNumber to set

getSenderAddress

public HostAddress getSenderAddress()
Returns:
the senderAddress

setSenderAddress

public void setSenderAddress(HostAddress senderAddress)
Parameters:
senderAddress - the senderAddress to set

getRecipientAddress

public HostAddress getRecipientAddress()
Returns:
the recipientAddress

setRecipientAddress

public void setRecipientAddress(HostAddress recipientAddress)
Parameters:
recipientAddress - the recipientAddress to set

computeLength

public int computeLength()
Compute the KRB-SAFE-BODY length:
 0x30 L1 KRB-SAFE-BODY SEQ
  |
  +--> 0xA0 L2 user-data tag
  |     |
  |     +--> 0x04 L2-1 user-data (Octet String)
  |
  +--> 0xA1 0x11 timestamp tag
  |     |
  |     +--> 0x18 0x0F timestamp (KerberosTime)
  |
  +--> 0xA2 L3 usec tag
  |     |
  |     +--> 0x02 L3-1 usec (Microseconds)
  |
  +--> 0xA3 L4 seq-number tag
  |     |
  |     +--> 0x02 L4-1 seqnumber (UInt32)
  |
  +--> 0xA4 L5 s-address tag
  |     |
  |     +--> 0x30 L5-1 s-address (HostAddress)
  |
  +--> 0xA5 L6 r-address tag
        |
        +--> 0x30 L6-1 r-address (HostAddress)
 


encode

public ByteBuffer encode(ByteBuffer buffer)
                  throws org.apache.directory.shared.asn1.EncoderException

Specified by:
encode in interface org.apache.directory.shared.asn1.Asn1Object
Overrides:
encode in class org.apache.directory.shared.asn1.AbstractAsn1Object
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.