public final class Timestamp
extends Object implements 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.

Summary

Public constructors

Timestamp(Date timestamp, CertPath signerCertPath)

Constructs a Timestamp.

Public methods

boolean equals(Object obj)

Tests for equality between the specified object and this timestamp.

CertPath getSignerCertPath()

Returns the certificate path for the Timestamping Authority.

Date getTimestamp()

Returns the date and time when the timestamp was generated.

int hashCode()

Returns the hash code value for this timestamp.

String toString()

Returns a string describing this timestamp.

Inherited methods

From class java.lang.Object

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Public constructors

Timestamp

public Timestamp (Date timestamp, 
                CertPath signerCertPath)

Constructs a Timestamp.

Parameters
timestamp Date: is the timestamp's date and time. It must not be null.
signerCertPath CertPath: is the TSA's certificate path. It must not be null.
Throws
NullPointerException if timestamp or signerCertPath is null.

Public methods

equals

public boolean equals (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.

Parameters
obj Object: the object to test for equality with this timestamp.
Returns
boolean true if the timestamp are considered equal, false otherwise.

getSignerCertPath

public CertPath getSignerCertPath ()

Returns the certificate path for the Timestamping Authority.

Returns
CertPath The TSA's certificate path.

getTimestamp

public Date getTimestamp ()

Returns the date and time when the timestamp was generated.

Returns
Date The timestamp's date and time.

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.

Returns
int a hash code value for this timestamp.

toString

public String toString ()

Returns a string describing this timestamp.

Returns
String A string comprising the date and time of the timestamp and its signer's certificate.

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2025-02-10 UTC.