Top Description Fields Constructors Methods
java.security

public final Class Timestamp

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.IOException, .ObjectInputStream, .Serializable, java.security.cert.CertPath, .Certificate, java.util.Date, .List

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.
Author
Vincent Ryan
Since
1.5

Field Summary

Modifier and TypeField and Description
private transient int
private static final long
private final CertPath
signerCertPath

The TSA's certificate path.

private Date
timestamp

The timestamp's date and time

Constructor Summary

AccessConstructor and Description
public
Timestamp(Date
is the timestamp's date and time. It must not be null.
timestamp
,
CertPath
is the TSA's certificate path. It must not be null.
signerCertPath
)

Constructs a Timestamp.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the timestamps are considered equal, false otherwise.
equals
(Object
the object to test for equality with this Timestamp.
obj
)

Overrides java.lang.Object.equals.

Tests for equality between the specified object and this Timestamp.

public CertPath

Returns:

The TSA's certificate path.
getSignerCertPath
()

Returns the certificate path for the Timestamping Authority.

public Date

Returns:

The timestamp's date and time.
getTimestamp
()

Returns the date and time when the Timestamp was generated.

public int

Returns:

a hash code value for this Timestamp.
hashCode
()

Overrides java.lang.Object.hashCode.

Returns the hash code value for this Timestamp.

private void
readObject(ObjectInputStream
the ObjectInputStream from which data is read
ois
)

Restores the state of this object from the stream, and explicitly resets hash code value to -1.

public String

Returns:

A string comprising the date and time of the Timestamp and its signer's certificate.
toString
()

Overrides java.lang.Object.toString.

Returns a string describing this Timestamp.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

myhashback to summary
private transient int myhash
serialVersionUIDback to summary
private static final long serialVersionUID
Annotations
@Serial
signerCertPathback to summary
private final CertPath signerCertPath

The TSA's certificate path.

timestampback to summary
private Date timestamp

The timestamp's date and time

Constructor Detail

Timestampback to summary
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.

Exceptions
NullPointerException:
if timestamp or signerCertPath is null.

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

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 timestamps are considered equal, false otherwise.

getSignerCertPathback to summary
public CertPath getSignerCertPath()

Returns the certificate path for the Timestamping Authority.

Returns:CertPath

The TSA's certificate path.

getTimestampback to summary
public Date getTimestamp()

Returns the date and time when the Timestamp was generated.

Returns:Date

The timestamp's date and time.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.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.

readObjectback to summary
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException

Restores the state of this object from the stream, and explicitly resets hash code value to -1.

Parameters
ois:ObjectInputStream

the ObjectInputStream from which data is read

Annotations
@Serial
Exceptions
IOException:
if an I/O error occurs
ClassNotFoundException:
if a serialized class cannot be loaded
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string describing this Timestamp.

Returns:String

A string comprising the date and time of the Timestamp and its signer's certificate.