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

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

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

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

 KDC-REQ-BODY    ::= SEQUENCE {
      kdc-options             [0] KDCOptions,
      cname                   [1] PrincipalName OPTIONAL
                                  -- Used only in AS-REQ --,
      realm                   [2] Realm
                                  -- Server's realm
                                  -- Also client's in AS-REQ --,
      sname                   [3] PrincipalName OPTIONAL,
      from                    [4] KerberosTime OPTIONAL,
      till                    [5] KerberosTime,
      rtime                   [6] KerberosTime OPTIONAL,
      nonce                   [7] UInt32,
      etype                   [8] SEQUENCE OF Int32 -- EncryptionType
                                  -- in preference order --,
      addresses               [9] HostAddresses OPTIONAL,
      enc-authorization-data  [10] EncryptedData OPTIONAL
                                  -- AuthorizationData --,
      additional-tickets      [11] SEQUENCE OF Ticket OPTIONAL
                                      -- NOTE: not empty
 }
 

Author:
Apache Directory Project

Constructor Summary
KdcReqBody()
          Creates a new instance of RequestBody.
 
Method Summary
 void addAdditionalTicket(Ticket additionalTicket)
          Add a new Ticket to the list of additional tickets
 void addEType(EncryptionType eType)
           
 int computeLength()
          Compute the KdcReqBody length
 ByteBuffer encode(ByteBuffer buffer)
          Encode the KDC-REQ-BODY component
 Ticket[] getAdditionalTickets()
          Returns the additional Tickets.
 HostAddresses getAddresses()
          Returns the HostAddresses.
 PrincipalName getCName()
           
 EncryptedData getEncAuthorizationData()
          Returns the encrypted AuthorizationData as EncryptedData.
 List<EncryptionType> getEType()
          Returns the requested EncryptionTypes.
 KerberosTime getFrom()
          Returns the from KerberosTime.
 KdcOptions getKdcOptions()
          Returns the KdcOptions.
 int getNonce()
          Returns the nonce.
 String getRealm()
           
 KerberosTime getRTime()
          Returns the RenewTime KerberosTime.
 PrincipalName getSName()
          Returns the server PrincipalName.
 KerberosTime getTill()
          Returns the till KerberosTime.
 void setAdditionalTickets(List<Ticket> additionalTickets)
          Set the list of additional Ticket
 void setAddresses(HostAddresses addresses)
           
 void setCName(PrincipalName cName)
           
 void setEncAuthorizationData(EncryptedData encAuthorizationData)
           
 void setEType(List<EncryptionType> eType)
           
 void setFrom(KerberosTime from)
           
 void setKdcOptions(KdcOptions kdcOptions)
           
 void setNonce(int nonce)
           
 void setRealm(String realm)
           
 void setRtime(KerberosTime rtime)
           
 void setSName(PrincipalName sName)
           
 void setTill(KerberosTime till)
           
 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

KdcReqBody

public KdcReqBody()
Creates a new instance of RequestBody.

Method Detail

getAdditionalTickets

public Ticket[] getAdditionalTickets()
Returns the additional Tickets.

Returns:
The additional Tickets.

setAdditionalTickets

public void setAdditionalTickets(List<Ticket> additionalTickets)
Set the list of additional Ticket

Parameters:
additionalTickets - the additionalTickets to set

addAdditionalTicket

public void addAdditionalTicket(Ticket additionalTicket)
Add a new Ticket to the list of additional tickets

Parameters:
additionalTickets - the additionalTickets to set

getAddresses

public HostAddresses getAddresses()
Returns the HostAddresses.

Returns:
The HostAddresses.

setAddresses

public void setAddresses(HostAddresses addresses)
Parameters:
addresses - the addresses to set

getCName

public PrincipalName getCName()
Returns:
the client PrincipalName

setCName

public void setCName(PrincipalName cName)
Parameters:
cName - the cName to set

getEncAuthorizationData

public EncryptedData getEncAuthorizationData()
Returns the encrypted AuthorizationData as EncryptedData.

Returns:
The encrypted AuthorizationData as EncryptedData.

setEncAuthorizationData

public void setEncAuthorizationData(EncryptedData encAuthorizationData)
Parameters:
encAuthorizationData - the encAuthorizationData to set

getEType

public List<EncryptionType> getEType()
Returns the requested EncryptionTypes.

Returns:
The requested EncryptionTypes.

setEType

public void setEType(List<EncryptionType> eType)
Parameters:
eType - the eType to set

addEType

public void addEType(EncryptionType eType)
Parameters:
eType - the eType to add

getFrom

public KerberosTime getFrom()
Returns the from KerberosTime.

Returns:
The from KerberosTime.

setFrom

public void setFrom(KerberosTime from)
Parameters:
from - the from to set

getKdcOptions

public KdcOptions getKdcOptions()
Returns the KdcOptions.

Returns:
The KdcOptions.

setKdcOptions

public void setKdcOptions(KdcOptions kdcOptions)
Parameters:
kdcOptions - the kdcOptions to set

getNonce

public int getNonce()
Returns the nonce.

Returns:
The nonce.

setNonce

public void setNonce(int nonce)
Parameters:
nonce - the nonce to set

getRealm

public String getRealm()
Returns:
the realm

setRealm

public void setRealm(String realm)
Parameters:
realm - the realm to set

getRTime

public KerberosTime getRTime()
Returns the RenewTime KerberosTime.

Returns:
The RenewTime KerberosTime.

setRtime

public void setRtime(KerberosTime rtime)
Parameters:
rtime - the renewTime to set

getSName

public PrincipalName getSName()
Returns the server PrincipalName.

Returns:
The server PrincipalName.

setSName

public void setSName(PrincipalName sName)
Parameters:
sName - the sName to set

getTill

public KerberosTime getTill()
Returns the till KerberosTime.

Returns:
The till KerberosTime.

setTill

public void setTill(KerberosTime till)
Parameters:
till - the till to set

computeLength

public int computeLength()
Compute the KdcReqBody length
 KdcReqBody :

 0x30 L1 KdcReqBody sequence
  |
  +--> 0xA0 L2 kdc-options tag
  |     |
  |     +--> 0x03 L2-1 kdc-options (BitString)
  |
  +--> 0xA1 L3 cname tag
  |     |
  |     +--> 0x30 L3-1 cname (PrincipalName)
  |
  +--> 0xA2 L4 realm tag
  |     |
  |     +--> 0x1B L4-1 realm (Realm, KerberosString)
  |
  +--> 0xA3 L5 sname tag
  |     |
  |     +--> 0x30 L5-1 sname (PrincipalName)
  |
  +--> 0xA4 L6 from tag
  |     |
  |     +--> 0x18 L6-1 from (KerberosTime)
  |
  +--> 0xA5 L7 till tag
  |     |
  |     +--> 0x18 L7-1 till (KerberosTime)
  |
  +--> 0xA6 L8 rtime tag
  |     |
  |     +--> 0x18 L8-1 rtime (KerberosTime)
  |
  +--> 0xA7 L9 nonce tag
  |     |
  |     +--> 0x02 L9-1 nonce (Int)
  |
  +--> 0xA8 L10 etype tag
  |     |
  |     +--> 0x30 L10-1 SEQ
  |           |
  |           +--> 0x02 L10-1-1 etype
  |           |
  |           +--> 0x02 L10-1-2 etype
  |           |
  |           :
  |
  +--> 0xA9 L11 addresses tag
  |     |
  |     +--> 0x30 L11-1 addresses (HostAddresses)
  |
  +--> 0xAA L12 enc-authorization-data tag
  |     |
  |     +--> 0x30 L12-1 enc-authorization-data
  |
  +--> 0xAB L13 additional-tickets tag
        |
        +--> 0x30 L13-1 additional-tickets
              |
              +--> 0x61 L13-1-1 Ticket
              |
              +--> 0x61 L13-1-2 Ticket
              |
              :
 


encode

public ByteBuffer encode(ByteBuffer buffer)
                  throws org.apache.directory.shared.asn1.EncoderException
Encode the KDC-REQ-BODY 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.