# Identity

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

# Identity

`
public


abstract
class
Identity
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


implements

`[Principal](https://developer.android.com/reference/java/security/Principal)`,

`[Serializable](https://developer.android.com/reference/java/io/Serializable)`


`

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

|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known direct subclasses [IdentityScope](https://developer.android.com/reference/java/security/IdentityScope),[Signer](https://developer.android.com/reference/java/security/Signer) |--------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [IdentityScope](https://developer.android.com/reference/java/security/IdentityScope) | *This class was deprecated in API level 3. This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by`java.security.KeyStore`, the`java.security.cert`package, and`java.security.Principal`.* | | [Signer](https://developer.android.com/reference/java/security/Signer)               | *This class was deprecated in API level 3. This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by`java.security.KeyStore`, the`java.security.cert`package, and`java.security.Principal`.* | |

<br />

*** ** * ** ***

<br />

**This class was deprecated in API level 3.**   
This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by`java.security.KeyStore`, the`java.security.cert`package, and`java.security.Principal`.

<br />

This class represents identities: real-world objects such as people, companies or organizations whose identities can be authenticated using their public keys. Identities may also be more abstract (or concrete) constructs, such as daemon threads or smart cards.

All Identity objects have a name and a public key. Names are immutable. Identities may also be scoped. That is, if an Identity is specified to have a particular scope, then the name and public key of the Identity are unique within that scope.

An Identity also has a set of certificates (all certifying its own public key). The Principal names specified in these certificates need not be the same, only the key.

An Identity can be subclassed, to include postal and email addresses, telephone numbers, images of faces and logos, and so on.  
**See also:**

- [IdentityScope](https://developer.android.com/reference/java/security/IdentityScope)
- [Signer](https://developer.android.com/reference/java/security/Signer)
- [Principal](https://developer.android.com/reference/java/security/Principal)

## Summary

|                                                                                                                                                                             ### Public constructors                                                                                                                                                                              ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[Identity](https://developer.android.com/reference/java/security/Identity#Identity(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` name) ` Constructs an identity with the specified name and no scope.                                                                                                                           |
| ` `[Identity](https://developer.android.com/reference/java/security/Identity#Identity(java.lang.String,%20java.security.IdentityScope))`(`[String](https://developer.android.com/reference/java/lang/String)` name, `[IdentityScope](https://developer.android.com/reference/java/security/IdentityScope)` scope) ` Constructs an identity with the specified name and scope. |

|                                                      ### Protected constructors                                                      ||
|-----------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[Identity](https://developer.android.com/reference/java/security/Identity#Identity())`() ` Constructor for serialization only. |

|                                                                                                                                                                               ### Public methods                                                                                                                                                                                ||
|-----------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void`                                                                                       | ` `[addCertificate](https://developer.android.com/reference/java/security/Identity#addCertificate(java.security.Certificate))`(`[Certificate](https://developer.android.com/reference/java/security/Certificate)` certificate) ` Adds a certificate for this identity.           |
| ` `[Certificate[]](https://developer.android.com/reference/java/security/Certificate)         | ` `[certificates](https://developer.android.com/reference/java/security/Identity#certificates())`() ` Returns a copy of all the certificates for this identity.                                                                                                                  |
| ` final boolean`                                                                              | ` `[equals](https://developer.android.com/reference/java/security/Identity#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` identity) ` Tests for equality between the specified object and this identity.                        |
| ` `[String](https://developer.android.com/reference/java/lang/String)                         | ` `[getInfo](https://developer.android.com/reference/java/security/Identity#getInfo())`() ` Returns general information previously specified for this identity.                                                                                                                  |
| ` final `[String](https://developer.android.com/reference/java/lang/String)                   | ` `[getName](https://developer.android.com/reference/java/security/Identity#getName())`() ` Returns this identity's name.                                                                                                                                                        |
| ` `[PublicKey](https://developer.android.com/reference/java/security/PublicKey)               | ` `[getPublicKey](https://developer.android.com/reference/java/security/Identity#getPublicKey())`() ` Returns this identity's public key.                                                                                                                                        |
| ` final `[IdentityScope](https://developer.android.com/reference/java/security/IdentityScope) | ` `[getScope](https://developer.android.com/reference/java/security/Identity#getScope())`() ` Returns this identity's scope.                                                                                                                                                     |
| ` int`                                                                                        | ` `[hashCode](https://developer.android.com/reference/java/security/Identity#hashCode())`() ` Returns a hashcode for this identity.                                                                                                                                              |
| ` void`                                                                                       | ` `[removeCertificate](https://developer.android.com/reference/java/security/Identity#removeCertificate(java.security.Certificate))`(`[Certificate](https://developer.android.com/reference/java/security/Certificate)` certificate) ` Removes a certificate from this identity. |
| ` void`                                                                                       | ` `[setInfo](https://developer.android.com/reference/java/security/Identity#setInfo(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` info) ` Specifies a general information string for this identity.                                   |
| ` void`                                                                                       | ` `[setPublicKey](https://developer.android.com/reference/java/security/Identity#setPublicKey(java.security.PublicKey))`(`[PublicKey](https://developer.android.com/reference/java/security/PublicKey)` key) ` Sets this identity's public key.                                  |
| ` `[String](https://developer.android.com/reference/java/lang/String)                         | ` `[toString](https://developer.android.com/reference/java/security/Identity#toString())`() ` Returns a short string describing this identity, telling its name and its scope (if any).                                                                                          |
| ` `[String](https://developer.android.com/reference/java/lang/String)                         | ` `[toString](https://developer.android.com/reference/java/security/Identity#toString(boolean))`(boolean detailed) ` Returns a string representation of this identity, with optionally more details than that provided by the`toString`method without any arguments.             |

|                                                                                                                                         ### Protected methods                                                                                                                                         ||
|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` boolean` | ` `[identityEquals](https://developer.android.com/reference/java/security/Identity#identityEquals(java.security.Identity))`(`[Identity](https://developer.android.com/reference/java/security/Identity)` identity) ` Tests for equality between the specified identity and this identity. |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](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 `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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*.                                                                                             | ||
| From interface` `[java.security.Principal](https://developer.android.com/reference/java/security/Principal)` ` |--------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract boolean`                                                            | ` `[equals](https://developer.android.com/reference/java/security/Principal#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` another) ` Compares this principal to the specified object.                                             | | ` abstract `[String](https://developer.android.com/reference/java/lang/String) | ` `[getName](https://developer.android.com/reference/java/security/Principal#getName())`() ` Returns the name of this principal.                                                                                                                                                    | | ` abstract int`                                                                | ` `[hashCode](https://developer.android.com/reference/java/security/Principal#hashCode())`() ` Returns a hashcode for this principal.                                                                                                                                               | | ` default boolean`                                                             | ` `[implies](https://developer.android.com/reference/java/security/Principal#implies(javax.security.auth.Subject))`(`[Subject](https://developer.android.com/reference/javax/security/auth/Subject)` subject) ` Returns true if the specified subject is implied by this principal. | | ` abstract `[String](https://developer.android.com/reference/java/lang/String) | ` `[toString](https://developer.android.com/reference/java/security/Principal#toString())`() ` Returns a string representation of this principal.                                                                                                                                   | ||

## Public constructors

### Identity

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

```
public Identity (String name)
```

Constructs an identity with the specified name and no scope.

<br />

|                 Parameters                  ||
|--------|-------------------------------------|
| `name` | `String`: the identity name. <br /> |

### Identity

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

```
public Identity (String name, 
                IdentityScope scope)
```

Constructs an identity with the specified name and scope.

<br />

|                         Parameters                          ||
|---------|----------------------------------------------------|
| `name`  | `String`: the identity name. <br />                |
| `scope` | `IdentityScope`: the scope of the identity. <br /> |

|                                                                                  Throws                                                                                  ||
|--------------------------------------------------------------------------------------------------------|------------------------------------------------------------------|
| [KeyManagementException](https://developer.android.com/reference/java/security/KeyManagementException) | if there is already an identity with the same name in the scope. |

## Protected constructors

### Identity

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

```
protected Identity ()
```

Constructor for serialization only.

<br />

## Public methods

### addCertificate

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

```
public void addCertificate (Certificate certificate)
```

Adds a certificate for this identity. If the identity has a public key, the public key in the certificate must be the same, and if the identity does not have a public key, the identity's public key is set to be that specified in the certificate.

First, if there is a security manager, its`checkSecurityAccess`method is called with`"addIdentityCertificate"`as its argument to see if it's ok to add a certificate.

<br />

|                            Parameters                             ||
|---------------|----------------------------------------------------|
| `certificate` | `Certificate`: the certificate to be added. <br /> |

|                                                                                                                                Throws                                                                                                                                ||
|--------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [KeyManagementException](https://developer.android.com/reference/java/security/KeyManagementException) | if the certificate is not valid, if the public key in the certificate being added conflicts with this identity's public key, or if another exception occurs. |
| [SecurityException](https://developer.android.com/reference/java/lang/SecurityException)               | if a security manager exists and its`checkSecurityAccess`method doesn't allow adding a certificate.                                                          |

**See also:**

- [SecurityManager.checkSecurityAccess(String)](https://developer.android.com/reference/java/lang/SecurityManager#checkSecurityAccess(java.lang.String))  

### certificates

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

```
public Certificate[] certificates ()
```

Returns a copy of all the certificates for this identity.

<br />

|                                                                   Returns                                                                    ||
|------------------------------------------------------------------------------------|----------------------------------------------------------|
| [Certificate[]](https://developer.android.com/reference/java/security/Certificate) | a copy of all the certificates for this identity. <br /> |

### equals

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

```
public final boolean equals (Object identity)
```

Tests for equality between the specified object and this identity. This first tests to see if the entities actually refer to the same object, in which case it returns true. Next, it checks to see if the entities have the same name and the same scope. If they do, the method returns true. Otherwise, it calls[identityEquals](https://developer.android.com/reference/java/security/Identity#identityEquals(java.security.Identity)), which subclasses should override.

<br />

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

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

**See also:**

- [identityEquals(Identity)](https://developer.android.com/reference/java/security/Identity#identityEquals(java.security.Identity))  

### getInfo

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

```
public String getInfo ()
```

Returns general information previously specified for this identity.

<br />

|                                                       Returns                                                       ||
|--------------------------------------------------------------------|-------------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | general information about this identity. <br /> |

**See also:**

- [setInfo(String)](https://developer.android.com/reference/java/security/Identity#setInfo(java.lang.String))  

### getName

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

```
public final String getName ()
```

Returns this identity's name.

<br />

|                                                Returns                                                ||
|--------------------------------------------------------------------|-----------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | the name of this identity. <br /> |

### getPublicKey

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

```
public PublicKey getPublicKey ()
```

Returns this identity's public key.

<br />

|                                                        Returns                                                         ||
|------------------------------------------------------------------------------|------------------------------------------|
| [PublicKey](https://developer.android.com/reference/java/security/PublicKey) | the public key for this identity. <br /> |

**See also:**

- [setPublicKey(PublicKey)](https://developer.android.com/reference/java/security/Identity#setPublicKey(java.security.PublicKey))  

### getScope

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

```
public final IdentityScope getScope ()
```

Returns this identity's scope.

<br />

|                                                         Returns                                                          ||
|--------------------------------------------------------------------------------------|------------------------------------|
| [IdentityScope](https://developer.android.com/reference/java/security/IdentityScope) | the scope of this identity. <br /> |

### hashCode

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

```
public int hashCode ()
```

Returns a hashcode for this identity.

<br />

|                   Returns                   ||
|-------|--------------------------------------|
| `int` | a hashcode for this identity. <br /> |

### removeCertificate

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

```
public void removeCertificate (Certificate certificate)
```

Removes a certificate from this identity.

First, if there is a security manager, its`checkSecurityAccess`method is called with`"removeIdentityCertificate"`as its argument to see if it's ok to remove a certificate.

<br />

|                             Parameters                              ||
|---------------|------------------------------------------------------|
| `certificate` | `Certificate`: the certificate to be removed. <br /> |

|                                                                                                    Throws                                                                                                     ||
|--------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
| [KeyManagementException](https://developer.android.com/reference/java/security/KeyManagementException) | if the certificate is missing, or if another exception occurs.                                        |
| [SecurityException](https://developer.android.com/reference/java/lang/SecurityException)               | if a security manager exists and its`checkSecurityAccess`method doesn't allow removing a certificate. |

**See also:**

- [SecurityManager.checkSecurityAccess(String)](https://developer.android.com/reference/java/lang/SecurityManager#checkSecurityAccess(java.lang.String))  

### setInfo

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

```
public void setInfo (String info)
```

Specifies a general information string for this identity.

First, if there is a security manager, its`checkSecurityAccess`method is called with`"setIdentityInfo"`as its argument to see if it's ok to specify the information string.

<br />

|                    Parameters                    ||
|--------|------------------------------------------|
| `info` | `String`: the information string. <br /> |

|                                                                                                 Throws                                                                                                  ||
|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------|
| [SecurityException](https://developer.android.com/reference/java/lang/SecurityException) | if a security manager exists and its`checkSecurityAccess`method doesn't allow setting the information string. |

**See also:**

- [getInfo()](https://developer.android.com/reference/java/security/Identity#getInfo())
- [SecurityManager.checkSecurityAccess(String)](https://developer.android.com/reference/java/lang/SecurityManager#checkSecurityAccess(java.lang.String))  

### setPublicKey

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

```
public void setPublicKey (PublicKey key)
```

Sets this identity's public key. The old key and all of this identity's certificates are removed by this operation.

First, if there is a security manager, its`checkSecurityAccess`method is called with`"setIdentityPublicKey"`as its argument to see if it's ok to set the public key.

<br />

|                          Parameters                          ||
|-------|-------------------------------------------------------|
| `key` | `PublicKey`: the public key for this identity. <br /> |

|                                                                                                    Throws                                                                                                     ||
|--------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
| [KeyManagementException](https://developer.android.com/reference/java/security/KeyManagementException) | if another identity in the identity's scope has the same public key, or if another exception occurs.  |
| [SecurityException](https://developer.android.com/reference/java/lang/SecurityException)               | if a security manager exists and its`checkSecurityAccess`method doesn't allow setting the public key. |

**See also:**

- [getPublicKey()](https://developer.android.com/reference/java/security/Identity#getPublicKey())
- [SecurityManager.checkSecurityAccess(String)](https://developer.android.com/reference/java/lang/SecurityManager#checkSecurityAccess(java.lang.String))  

### toString

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

```
public String toString ()
```

Returns a short string describing this identity, telling its name and its scope (if any).

First, if there is a security manager, its`checkSecurityAccess`method is called with`"printIdentity"`as its argument to see if it's ok to return the string.

<br />

|                                                                             Returns                                                                              ||
|--------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | information about this identity, such as its name and the name of its scope (if any). <br /> |

|                                                                                                        Throws                                                                                                        ||
|------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------|
| [SecurityException](https://developer.android.com/reference/java/lang/SecurityException) | if a security manager exists and its`checkSecurityAccess`method doesn't allow returning a string describing this identity. |

**See also:**

- [SecurityManager.checkSecurityAccess(String)](https://developer.android.com/reference/java/lang/SecurityManager#checkSecurityAccess(java.lang.String))  

### toString

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

```
public String toString (boolean detailed)
```

Returns a string representation of this identity, with optionally more details than that provided by the`toString`method without any arguments.

First, if there is a security manager, its`checkSecurityAccess`method is called with`"printIdentity"`as its argument to see if it's ok to return the string.

<br />

|                                  Parameters                                   ||
|------------|-------------------------------------------------------------------|
| `detailed` | `boolean`: whether or not to provide detailed information. <br /> |

|                                                                                                                   Returns                                                                                                                   ||
|--------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | information about this identity. If`detailed`is true, then this method returns more information than that provided by the`toString`method without any arguments. <br /> |

|                                                                                                        Throws                                                                                                        ||
|------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------|
| [SecurityException](https://developer.android.com/reference/java/lang/SecurityException) | if a security manager exists and its`checkSecurityAccess`method doesn't allow returning a string describing this identity. |

**See also:**

- [toString()](https://developer.android.com/reference/java/security/Identity#toString())
- [SecurityManager.checkSecurityAccess(String)](https://developer.android.com/reference/java/lang/SecurityManager#checkSecurityAccess(java.lang.String))

## Protected methods

### identityEquals

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

```
protected boolean identityEquals (Identity identity)
```

Tests for equality between the specified identity and this identity. This method should be overriden by subclasses to test for equality. The default behavior is to return true if the names and public keys are equal.

<br />

|                                      Parameters                                      ||
|------------|--------------------------------------------------------------------------|
| `identity` | `Identity`: the identity to test for equality with this identity. <br /> |

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

**See also:**

- [equals(Object)](https://developer.android.com/reference/java/security/Identity#equals(java.lang.Object))