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/CodeSigner#pubctors) \| [Methods](https://developer.android.com/reference/java/security/CodeSigner#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/java/security/CodeSigner#inhmethods)

# CodeSigner

` public final class CodeSigner `   
` 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.CodeSigner |

<br />

*** ** * ** ***

This class encapsulates information about a code signer. It is immutable.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/java/security/CodeSigner#CodeSigner(java.security.cert.CertPath,%20java.security.Timestamp)(https://developer.android.com/reference/java/security/cert/CertPath signerCertPath, https://developer.android.com/reference/java/security/Timestamp timestamp) ` Constructs a CodeSigner object. |

| ### Public methods ||
|---|---|
| ` boolean` | ` https://developer.android.com/reference/java/security/CodeSigner#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Tests for equality between the specified object and this code signer. |
| ` https://developer.android.com/reference/java/security/cert/CertPath` | ` https://developer.android.com/reference/java/security/CodeSigner#getSignerCertPath()() ` Returns the signer's certificate path. |
| ` https://developer.android.com/reference/java/security/Timestamp` | ` https://developer.android.com/reference/java/security/CodeSigner#getTimestamp()() ` Returns the signature timestamp. |
| ` int` | ` https://developer.android.com/reference/java/security/CodeSigner#hashCode()() ` Returns the hash code value for this code signer. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/security/CodeSigner#toString()() ` Returns a string describing this code signer. |

### 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

### CodeSigner

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

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

Constructs a CodeSigner object.

<br />

| Parameters ||
|---|---|
| `signerCertPath` | `CertPath`: The signer's certificate path. It must not be `null`. <br /> |
| `timestamp` | `Timestamp`: A signature timestamp. If `null` then no timestamp was generated for the signature. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if `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 code signer. Two code signers are considered equal if their signer certificate paths are equal and if their timestamps are equal, if present in both.

<br />

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

| Returns ||
|---|---|
| `boolean` | true if the objects 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 signer's certificate path.

<br />

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

### getTimestamp

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

```
public Timestamp getTimestamp ()
```

Returns the signature timestamp.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/security/Timestamp` | The timestamp or `null` if none is present. <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 code signer. The hash code is generated using the signer's certificate path and the timestamp, if present.

<br />

| Returns ||
|---|---|
| `int` | a hash code value for this code signer. <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 code signer.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | A string comprising the signer's certificate and a timestamp, if present. <br /> |