ajanta.util
Class Ticket

java.lang.Object
  |
  +--ajanta.util.Ticket
All Implemented Interfaces:
java.io.Serializable

public class Ticket
extends java.lang.Object
implements java.io.Serializable

The Ticket class represents a type of capability required by clients to invoke services which require authentication. It contains the ticket holder's name (URN) along with its signature on a nonce, i.e. a challenge which was previously sent to it by the service. It can optionally contain anothe nonce of its own, which challenges the service to prove its identity.

See Also:
Ticketing, Serialized Form

Field Summary
 int challenge
           
 ajanta.util.ContextObject context
           
 byte[] signature
           
 ajanta.naming.URN signer
           
 
Constructor Summary
Ticket(ajanta.util.Ticket t, ajanta.naming.URN signer, java.security.PrivateKey key)
          This constructor takes as parameter a Ticket object which has been sent to the client by a server, and extracts the nonce contained in it.
Ticket(ajanta.naming.URN u, byte[] s, int n)
           
 
Method Summary
 void setContext(ajanta.util.ContextObject context)
           
 java.lang.String toString()
          Converts the Ticket object to a String representation suitable for printing onto the screen.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

signer

public ajanta.naming.URN signer

signature

public byte[] signature

challenge

public int challenge

context

public ajanta.util.ContextObject context
Constructor Detail

Ticket

public Ticket(ajanta.naming.URN u,
              byte[] s,
              int n)

Ticket

public Ticket(ajanta.util.Ticket t,
              ajanta.naming.URN signer,
              java.security.PrivateKey key)
       throws java.security.NoSuchAlgorithmException,
              java.security.InvalidKeyException,
              java.security.SignatureException
This constructor takes as parameter a Ticket object which has been sent to the client by a server, and extracts the nonce contained in it. This nonce is signed using the given private key, and stored in this new Ticket object. Also, the nonce contained in the original Ticket is then incremented, so that the Ticket can be reused for future interactions with the same service.

Parameters:
t - The original Ticket containing the nonce to be signed.
signer - The name of the client, to be inserted into the Ticket being constructed here.
key - The private key to be used for signing the nonce.
Method Detail

toString

public java.lang.String toString()
Converts the Ticket object to a String representation suitable for printing onto the screen.

Overrides:
toString in class java.lang.Object

setContext

public void setContext(ajanta.util.ContextObject context)