java.security
Class Timestamp

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.security.Timestamp
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable

public final class Timestamp
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements Serializable sample code for java.io.Serializable definition code for java.io.Serializable

This class encapsulates information about a signed timestamp. It is immutable. It includes the timestamp's date and time as well as information about the Timestamping Authority (TSA) which generated and signed the timestamp.

Since:
1.5
See Also:
Serialized Form

Constructor Summary
Timestamp sample code for java.security.Timestamp.Timestamp(java.util.Date, java.security.cert.CertPath) definition code for java.security.Timestamp.Timestamp(java.util.Date, java.security.cert.CertPath) (Date sample code for java.util.Date definition code for java.util.Date  timestamp, CertPath sample code for java.security.cert.CertPath definition code for java.security.cert.CertPath  signerCertPath)
          Constructs a Timestamp.
 
Method Summary
 boolean equals sample code for java.security.Timestamp.equals(java.lang.Object) definition code for java.security.Timestamp.equals(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  obj)
          Tests for equality between the specified object and this timestamp.
 CertPath sample code for java.security.cert.CertPath definition code for java.security.cert.CertPath getSignerCertPath sample code for java.security.Timestamp.getSignerCertPath() definition code for java.security.Timestamp.getSignerCertPath() ()
          Returns the certificate path for the Timestamping Authority.
 Date sample code for java.util.Date definition code for java.util.Date getTimestamp sample code for java.security.Timestamp.getTimestamp() definition code for java.security.Timestamp.getTimestamp() ()
          Returns the date and time when the timestamp was generated.
 int hashCode sample code for java.security.Timestamp.hashCode() definition code for java.security.Timestamp.hashCode() ()
          Returns the hash code value for this timestamp.
 String sample code for java.lang.String definition code for java.lang.String toString sample code for java.security.Timestamp.toString() definition code for java.security.Timestamp.toString() ()
          Returns a string describing this timestamp.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

Timestamp sample code for java.security.Timestamp(java.util.Date, java.security.cert.CertPath) definition code for java.security.Timestamp(java.util.Date, java.security.cert.CertPath)

public Timestamp(Date sample code for java.util.Date definition code for java.util.Date  timestamp,
                 CertPath sample code for java.security.cert.CertPath definition code for java.security.cert.CertPath  signerCertPath)
Constructs a Timestamp.

Parameters:
timestamp - is the timestamp's date and time. It must not be null.
signerCertPath - is the TSA's certificate path. It must not be null.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if timestamp or signerCertPath is null.
Method Detail

getTimestamp sample code for java.security.Timestamp.getTimestamp() definition code for java.security.Timestamp.getTimestamp()

public Date sample code for java.util.Date definition code for java.util.Date  getTimestamp()
Returns the date and time when the timestamp was generated.

Returns:
The timestamp's date and time.

getSignerCertPath sample code for java.security.Timestamp.getSignerCertPath() definition code for java.security.Timestamp.getSignerCertPath()

public CertPath sample code for java.security.cert.CertPath definition code for java.security.cert.CertPath  getSignerCertPath()
Returns the certificate path for the Timestamping Authority.

Returns:
The TSA's certificate path.

hashCode sample code for java.security.Timestamp.hashCode() definition code for java.security.Timestamp.hashCode()

public int hashCode()
Returns the hash code value for this timestamp. The hash code is generated using the date and time of the timestamp and the TSA's certificate path.

Overrides:
hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a hash code value for this timestamp.
See Also:
Object.equals(java.lang.Object) sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

equals sample code for java.security.Timestamp.equals(java.lang.Object) definition code for java.security.Timestamp.equals(java.lang.Object)

public boolean equals(Object sample code for java.lang.Object definition code for java.lang.Object  obj)
Tests for equality between the specified object and this timestamp. Two timestamps are considered equal if the date and time of their timestamp's and their signer's certificate paths are equal.

Overrides:
equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) in class Object sample code for java.lang.Object definition code for java.lang.Object
Parameters:
obj - the object to test for equality with this timestamp.
Returns:
true if the timestamp are considered equal, false otherwise.
See Also:
Object.hashCode() sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

toString sample code for java.security.Timestamp.toString() definition code for java.security.Timestamp.toString()

public String sample code for java.lang.String definition code for java.lang.String  toString()
Returns a string describing this timestamp.

Overrides:
toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
A string comprising the date and time of the timestamp and its signer's certificate.