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

java.lang.Object
  extended by org.apache.directory.shared.asn1.AbstractAsn1Object
      extended by org.apache.directory.shared.kerberos.messages.KerberosMessage
          extended by org.apache.directory.shared.kerberos.components.KdcReq
All Implemented Interfaces:
org.apache.directory.shared.asn1.Asn1Object
Direct Known Subclasses:
AsReq, TgsReq

public abstract class KdcReq
extends KerberosMessage

The KDC-REQ data structure. It will store the object described by the ASN.1 grammar :

 KDC-REQ    ::= SEQUENCE {
      -- NOTE: first tag is [1], not [0]
      pvno            [1] INTEGER (5) ,
      msg-type        [2] INTEGER (10 -- AS -- | 12 -- TGS --),
      padata          [3] SEQUENCE OF  OPTIONAL
                            -- NOTE: not empty --,
      req-body        [4] 
 }
 

Author:
Apache Directory Project

Constructor Summary
KdcReq(KerberosMessageType msgType)
          Creates a new instance of KDC-REQ.
 
Method Summary
 void addPaData(PaData paData)
           
 int computeLength()
          Compute the KDC-REQ length
 ByteBuffer encode(ByteBuffer buffer)
          Encode the KDC-REQ component
 KdcReqBody getKdcReqBody()
           
 List<PaData> getPaData()
           
 int getPvno()
           
 void setKdcReqBody(KdcReqBody kdcReqBody)
           
 void setPvno(int pvno)
           
 String toString()
           
 
Methods inherited from class org.apache.directory.shared.kerberos.messages.KerberosMessage
getMessageType, getProtocolVersionNumber, setMessageType, setProtocolVersionNumber
 
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

KdcReq

public KdcReq(KerberosMessageType msgType)
Creates a new instance of KDC-REQ.

Method Detail

getPvno

public int getPvno()
Returns:
the pvno

setPvno

public void setPvno(int pvno)
Parameters:
pvno - the pvno to set

getPaData

public List<PaData> getPaData()
Returns:
the paData

addPaData

public void addPaData(PaData paData)
Parameters:
paData - the paData to set

getKdcReqBody

public KdcReqBody getKdcReqBody()
Returns:
the kdcReqBody

setKdcReqBody

public void setKdcReqBody(KdcReqBody kdcReqBody)
Parameters:
kdcReqBody - the kdcReqBody to set

computeLength

public int computeLength()
Compute the KDC-REQ length
 KDC-REQ :
 
 0x30 L1 KDC-REQ sequence
  |
  +--> 0xA1 0x03 pvno tag
  |     |
  |     +--> 0x02 0x01 0x05 pvno (5)
  |
  +--> 0xA2 0x03 msg-type tag
  |     |
  |     +--> 0x02 0x01 0x0A/0x0C msg-type : either AS-REQ (0x0A) or TGS-REQ (0x0C)
  |     
  +--> 0xA3 L2 pa-data tag
  |     |
  |     +--> 0x30 L2-1 pa-data SEQ
  |           |
  |           +--> 0x30 L2-1-1 pa-data
  |           |
  |           +--> 0x30 L2-1-2 pa-data
  |           :
  |     
  +--> 0xA4 L3 req-body tag
  |     |
  |     +--> 0x30 L3-1 req-body (KDC-REQ-BODY)
 


encode

public ByteBuffer encode(ByteBuffer buffer)
                  throws org.apache.directory.shared.asn1.EncoderException
Encode the KDC-REQ component

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 containing the encoded result
Returns:
The encoded component
Throws:
org.apache.directory.shared.asn1.EncoderException - If the encoding failed

toString

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


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