Package java.security

Class Timestamp

java.lang.Object
java.security.Timestamp
All Implemented Interfaces:
Serializable

public final class Timestamp
extends Object
implements Serializable
Timestamp represents a signed time stamp. Timestamp is immutable.
See Also:
Serialized Form
  • Constructor Summary

    Constructors
    Constructor Description
    Timestamp​(Date timestamp, CertPath signerCertPath)
    Constructs a new instance of Timestamp with the specified timestamp and the given certificate path.
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(Object obj)
    Compares the specified object with this Timestamp for equality and returns true if the specified object is equal, false otherwise.
    CertPath getSignerCertPath()
    Returns the certificate path of this Timestamp.
    Date getTimestamp()
    Returns the date and time of this Timestamp.
    int hashCode()
    Returns the hash code value for this Timestamp.
    String toString()
    Returns a string containing a concise, human-readable description of this Timestamp.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Timestamp

      public Timestamp​(Date timestamp, CertPath signerCertPath)
      Constructs a new instance of Timestamp with the specified timestamp and the given certificate path.
      Parameters:
      timestamp - date and time.
      signerCertPath - the certificate path.
      Throws:
      NullPointerException - if timestamp is null or if signerCertPath is null.
  • Method Details

    • equals

      public boolean equals​(Object obj)
      Compares the specified object with this Timestamp for equality and returns true if the specified object is equal, false otherwise. The given object is equal to this Timestamp, if it is an instance of Timestamp, the two timestamps have an equal date and time and their certificate paths are equal.
      Overrides:
      equals in class Object
      Parameters:
      obj - object to be compared for equality with this Timestamp.
      Returns:
      true if the specified object is equal to this Timestamp, otherwise false.
      See Also:
      hashCode()
    • getSignerCertPath

      public CertPath getSignerCertPath()
      Returns the certificate path of this Timestamp.
      Returns:
      the certificate path of this Timestamp.
    • getTimestamp

      public Date getTimestamp()
      Returns the date and time of this Timestamp.
      Returns:
      the date and time of this Timestamp.
    • hashCode

      public int hashCode()
      Returns the hash code value for this Timestamp. Returns the same hash code for Timestamps that are equal to each other as required by the general contract of Object.hashCode().
      Overrides:
      hashCode in class Object
      Returns:
      the hash code value for this Timestamp.
      See Also:
      Object.equals(Object), equals(Object)
    • toString

      public String toString()
      Returns a string containing a concise, human-readable description of this Timestamp.
      Overrides:
      toString in class Object
      Returns:
      a printable representation for this Timestamp.