Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/java/security/Timestamp#pubctors) \| [Methods](https://developer.android.com/reference/java/security/Timestamp#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/java/security/Timestamp#inhmethods)

# Timestamp


`
public

final

class
Timestamp
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


implements

https://developer.android.com/reference/java/io/Serializable


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | java.security.Timestamp |

<br />

*** ** * ** ***

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 ||
|---|---|
| ` https://developer.android.com/reference/java/security/Timestamp#Timestamp(java.util.Date,%20java.security.cert.CertPath)(https://developer.android.com/reference/java/util/Date timestamp, https://developer.android.com/reference/java/security/cert/CertPath signerCertPath) ` Constructs a Timestamp. |

| ### Public methods ||
|---|---|
| ` boolean` | ` https://developer.android.com/reference/java/security/Timestamp#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Tests for equality between the specified object and this timestamp. |
| ` https://developer.android.com/reference/java/security/cert/CertPath` | ` https://developer.android.com/reference/java/security/Timestamp#getSignerCertPath()() ` Returns the certificate path for the Timestamping Authority. |
| ` https://developer.android.com/reference/java/util/Date` | ` https://developer.android.com/reference/java/security/Timestamp#getTimestamp()() ` Returns the date and time when the timestamp was generated. |
| ` int` | ` https://developer.android.com/reference/java/security/Timestamp#hashCode()() ` Returns the hash code value for this timestamp. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/security/Timestamp#toString()() ` Returns a string describing this timestamp. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(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` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(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` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Public constructors

### Timestamp

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Timestamp (Date timestamp, 
                CertPath signerCertPath)
```

Constructs a Timestamp.

<br />

| Parameters ||
|---|---|
| `timestamp` | `Date`: is the timestamp's date and time. It must not be null. <br /> |
| `signerCertPath` | `CertPath`: is the TSA's certificate path. It must not be null. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if timestamp or signerCertPath is null. |

## Public methods

### equals

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

| Parameters ||
|---|---|
| `obj` | `Object`: the object to test for equality with this timestamp. <br /> |

| Returns ||
|---|---|
| `boolean` | true if the timestamp are considered equal, false otherwise. <br /> |

### getSignerCertPath

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public CertPath getSignerCertPath ()
```

Returns the certificate path for the Timestamping Authority.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/security/cert/CertPath` | The TSA's certificate path. <br /> |

### getTimestamp

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Date getTimestamp ()
```

Returns the date and time when the timestamp was generated.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Date` | The timestamp's date and time. <br /> |

### hashCode

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

| Returns ||
|---|---|
| `int` | a hash code value for this timestamp. <br /> |

### toString

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Returns a string describing this timestamp.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | A string comprising the date and time of the timestamp and its signer's certificate. <br /> |