br.shob
Class TimeStamp

java.lang.Object
  |
  +--br.shob.TimeStamp
All Implemented Interfaces:
Serializable

public class TimeStamp
extends Object
implements Serializable

TimeStamp is a wraper for a java.util.Date object.
It is responsible for signatura validation, ensuring that this date was generated by the serever.
Only the server should create TimeStamps.

Version:
$Revision: 1.4 $
Author:
crolmos, dukejeffrie
See Also:
Serialized Form
Created:
September 1, 2002

Constructor Summary
TimeStamp(Date d, PrivateKey key)
          Main contructor for the class.
 
Method Summary
 boolean before(TimeStamp other)
          Description of the Method
 int compareTo(TimeStamp other)
          Description of the Method
 Date getDate()
          accessor for the date object.
 String toString()
          Description of the Method
 boolean verify(PublicKey key)
          verifies the autenticity of the TimeStamp.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimeStamp

public TimeStamp(Date d,
                 PrivateKey key)
          throws InsecureObjectException
Main contructor for the class.

Parameters:
d - the date object to be signed.
key - the private key used for signing.
Throws:
InsecureObjectException - Description of the Exception
InsecureObjectException - if the signing process fails.
Method Detail

before

public boolean before(TimeStamp other)
               throws InsecureObjectException
Description of the Method

Parameters:
other - Description of the Parameter
Returns:
Description of the Return Value
Throws:
InsecureObjectException - Description of the Exception

compareTo

public int compareTo(TimeStamp other)
              throws InsecureObjectException
Description of the Method

Parameters:
other - Description of the Parameter
Returns:
Description of the Return Value
Throws:
InsecureObjectException - Description of the Exception

getDate

public Date getDate()
             throws InsecureObjectException
accessor for the date object.

Returns:
the Date of this time stamp.
Throws:
InsecureObjectException - if the signing process fails.

toString

public String toString()
Description of the Method

Overrides:
toString in class Object
Returns:
Description of the Return Value

verify

public boolean verify(PublicKey key)
               throws InsecureObjectException
verifies the autenticity of the TimeStamp.

Parameters:
key - the public key used in the verification process.
Returns:
true if the digital signature is valid, false otherwise.
Throws:
InsecureObjectException - if the signing process fails.