org.apache.directory.server.kerberos.shared.messages.components
Class Ticket

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

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

Ticket message component as handed out by the ticket granting service.

Version:
$Rev: 642496 $, $Date: 2008-03-29 04:09:22 +0100 (Sa, 29 M??r 2008) $
Author:
Apache Directory Project

Field Summary
static int TICKET_VNO
          Constant for the Ticket version number (5)
 
Fields inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object
parent
 
Constructor Summary
Ticket()
          Creates a new instance of Ticket.
Ticket(int tktvno, javax.security.auth.kerberos.KerberosPrincipal serverPrincipal, EncryptedData encPart)
          Creates a new instance of Ticket.
Ticket(javax.security.auth.kerberos.KerberosPrincipal serverPrincipal, EncryptedData encPart)
          Creates a new instance of Ticket.
 
Method Summary
 int computeLength()
          Compute the Ticket length Ticket : 0x61 L1 Ticket [APPLICATION 1] | +--> 0x30 L2 Ticket SEQUENCE | +--> 0xA0 L3 tkt-vno tag | | | +--> 0x02 L3-1 tkt-vno (int, 5) | +--> 0xA1 L4 realm tag | | | +--> 0x1B L4-1 realm (KerberosString) | +--> 0xA2 L5 sname (PrincipalName) | +--> 0xA3 L6 enc-part (EncryptedData)
 java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
          Encode the Ticket message to a PDU.
 EncryptedData getEncPart()
          Returns the EncryptedData.
 EncTicketPart getEncTicketPart()
          Returns the EncTicketPart.
 java.lang.String getRealm()
          Returns the server realm.
 javax.security.auth.kerberos.KerberosPrincipal getServerPrincipal()
          Returns the server KerberosPrincipal.
 PrincipalName getSName()
          Returns the server PrincipalName.
 int getTktVno()
          Returns the version number.
 void setEncPart(EncryptedData encPart)
          Set the encrypted ticket part
 void setEncTicketPart(EncTicketPart decryptedPart)
          Sets the EncTicketPart.
 void setRealm(java.lang.String realm)
          Set the server realm
 void setServerPrincipal(javax.security.auth.kerberos.KerberosPrincipal serverPrincipal)
          Set the server KerberosPrincipal
 void setSName(PrincipalName sName)
          Set the server principalName
 void setTktVno(int tktvno)
          Set the ticket version number
 
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, toString, wait, wait, wait
 

Field Detail

TICKET_VNO

public static final int TICKET_VNO
Constant for the Ticket version number (5)

See Also:
Constant Field Values
Constructor Detail

Ticket

public Ticket(javax.security.auth.kerberos.KerberosPrincipal serverPrincipal,
              EncryptedData encPart)
       throws InvalidTicketException
Creates a new instance of Ticket.

Parameters:
serverPrincipal - The server principal
encPart - The encoded part
Throws:
InvalidTicketException

Ticket

public Ticket()
Creates a new instance of Ticket.


Ticket

public Ticket(int tktvno,
              javax.security.auth.kerberos.KerberosPrincipal serverPrincipal,
              EncryptedData encPart)
       throws InvalidTicketException
Creates a new instance of Ticket.

Parameters:
tktvno - The Kerberos version number
serverPrincipal - The server principal
encPart - The encoded part
Throws:
InvalidTicketException
Method Detail

setEncTicketPart

public void setEncTicketPart(EncTicketPart decryptedPart)
Sets the EncTicketPart.

Parameters:
decryptedPart -

getTktVno

public int getTktVno()
Returns the version number.

Returns:
The version number.

setTktVno

public void setTktVno(int tktvno)
Set the ticket version number

Parameters:
tktvno - the ticket version number

getSName

public PrincipalName getSName()
Returns the server PrincipalName.

Returns:
The server PrincipalName.

getServerPrincipal

public javax.security.auth.kerberos.KerberosPrincipal getServerPrincipal()
Returns the server KerberosPrincipal.

Returns:
The server KerberosPrincipal.

setSName

public void setSName(PrincipalName sName)
Set the server principalName

Parameters:
sName - the server principalName

setServerPrincipal

public void setServerPrincipal(javax.security.auth.kerberos.KerberosPrincipal serverPrincipal)
                        throws InvalidTicketException
Set the server KerberosPrincipal

Parameters:
serverPrincipal - the server KerberosPrincipal
Throws:
InvalidTicketException

getRealm

public java.lang.String getRealm()
Returns the server realm.

Returns:
The server realm.

setRealm

public void setRealm(java.lang.String realm)
Set the server realm

Parameters:
realm - the server realm

getEncPart

public EncryptedData getEncPart()
Returns the EncryptedData.

Returns:
The EncryptedData.

setEncPart

public void setEncPart(EncryptedData encPart)
Set the encrypted ticket part

Parameters:
encPart - the encrypted ticket part

getEncTicketPart

public EncTicketPart getEncTicketPart()
Returns the EncTicketPart.

Returns:
The EncTicketPart.

computeLength

public int computeLength()
Compute the Ticket length Ticket : 0x61 L1 Ticket [APPLICATION 1] | +--> 0x30 L2 Ticket SEQUENCE | +--> 0xA0 L3 tkt-vno tag | | | +--> 0x02 L3-1 tkt-vno (int, 5) | +--> 0xA1 L4 realm tag | | | +--> 0x1B L4-1 realm (KerberosString) | +--> 0xA2 L5 sname (PrincipalName) | +--> 0xA3 L6 enc-part (EncryptedData)

Specified by:
computeLength in interface org.apache.directory.shared.asn1.Asn1Object
Specified by:
computeLength in class org.apache.directory.shared.asn1.AbstractAsn1Object

encode

public java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
                           throws org.apache.directory.shared.asn1.codec.EncoderException
Encode the Ticket message to a PDU. Ticket : 0x61 LL 0x30 LL 0xA0 LL tktvno 0xA1 LL realm 0xA2 LL sname (PrincipalName) 0xA3 LL enc-part (EncryptedData)

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


Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.