Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/security/identity/ResultData#constants) \| [Methods](https://developer.android.com/reference/android/security/identity/ResultData#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/security/identity/ResultData#inhmethods)

# ResultData

*** ** * ** ***


`
public


abstract
class
ResultData
`


`

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


`

`


`

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

<br />

*** ** * ** ***


**This class was deprecated
in API level 33.**   

Use `https://developer.android.com/reference/android/security/identity/PresentationSession` instead.

An object that contains the result of retrieving data from a credential. This is used to return
data requested from a `https://developer.android.com/reference/android/security/identity/IdentityCredential`.

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/security/identity/ResultData#STATUS_NOT_IN_REQUEST_MESSAGE` The entry wasn't in the request message. |
| `int` | `https://developer.android.com/reference/android/security/identity/ResultData#STATUS_NOT_REQUESTED` The entry was not requested. |
| `int` | `https://developer.android.com/reference/android/security/identity/ResultData#STATUS_NO_ACCESS_CONTROL_PROFILES` *This constant is deprecated. Use `java.security.KeyStore` with the Android hardware-backed keystore instead.* |
| `int` | `https://developer.android.com/reference/android/security/identity/ResultData#STATUS_NO_SUCH_ENTRY` The entry does not exist. |
| `int` | `https://developer.android.com/reference/android/security/identity/ResultData#STATUS_OK` Value was successfully retrieved. |
| `int` | `https://developer.android.com/reference/android/security/identity/ResultData#STATUS_READER_AUTHENTICATION_FAILED` The entry was not retrieved because reader authentication failed. |
| `int` | `https://developer.android.com/reference/android/security/identity/ResultData#STATUS_USER_AUTHENTICATION_FAILED` The entry was not retrieved because user authentication failed. |

| ### Public methods ||
|---|---|
| ` abstract byte[]` | ` https://developer.android.com/reference/android/security/identity/ResultData#getAuthenticatedData()() ` *This method is deprecated. Use `java.security.KeyStore` with the Android hardware-backed keystore instead.* |
| ` abstract byte[]` | ` https://developer.android.com/reference/android/security/identity/ResultData#getEntry(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String namespaceName, https://developer.android.com/reference/java/lang/String name) ` *This method is deprecated. Use `java.security.KeyStore` with the Android hardware-backed keystore instead.* |
| ` abstract https://developer.android.com/reference/java/util/Collection<https://developer.android.com/reference/java/lang/String>` | ` https://developer.android.com/reference/android/security/identity/ResultData#getEntryNames(java.lang.String)(https://developer.android.com/reference/java/lang/String namespaceName) ` *This method is deprecated. Use `java.security.KeyStore` with the Android hardware-backed keystore instead.* |
| ` abstract byte[]` | ` https://developer.android.com/reference/android/security/identity/ResultData#getMessageAuthenticationCode()() ` *This method is deprecated. Use `java.security.KeyStore` with the Android hardware-backed keystore instead.* |
| ` abstract https://developer.android.com/reference/java/util/Collection<https://developer.android.com/reference/java/lang/String>` | ` https://developer.android.com/reference/android/security/identity/ResultData#getNamespaces()() ` *This method is deprecated. Use `java.security.KeyStore` with the Android hardware-backed keystore instead.* |
| ` abstract https://developer.android.com/reference/java/util/Collection<https://developer.android.com/reference/java/lang/String>` | ` https://developer.android.com/reference/android/security/identity/ResultData#getRetrievedEntryNames(java.lang.String)(https://developer.android.com/reference/java/lang/String namespaceName) ` *This method is deprecated. Use `java.security.KeyStore` with the Android hardware-backed keystore instead.* |
| ` abstract byte[]` | ` https://developer.android.com/reference/android/security/identity/ResultData#getStaticAuthenticationData()() ` *This method is deprecated. Use `java.security.KeyStore` with the Android hardware-backed keystore instead.* |
| ` abstract int` | ` https://developer.android.com/reference/android/security/identity/ResultData#getStatus(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String namespaceName, https://developer.android.com/reference/java/lang/String name) ` *This method is deprecated. Use `java.security.KeyStore` with the Android hardware-backed keystore instead.* |

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

## Constants

### STATUS_NOT_IN_REQUEST_MESSAGE

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

```
public static final int STATUS_NOT_IN_REQUEST_MESSAGE
```

The entry wasn't in the request message.

<br />

Constant Value:

3
(0x00000003)


### STATUS_NOT_REQUESTED

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

```
public static final int STATUS_NOT_REQUESTED
```

The entry was not requested.

<br />

Constant Value:

2
(0x00000002)


### STATUS_NO_ACCESS_CONTROL_PROFILES

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

```
public static final int STATUS_NO_ACCESS_CONTROL_PROFILES
```


**This constant is deprecated.**   

Use `java.security.KeyStore` with the Android hardware-backed keystore
instead.

The entry was not retrieved because it was configured without any access
control profile.

<br />

Constant Value:

6
(0x00000006)


### STATUS_NO_SUCH_ENTRY

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

```
public static final int STATUS_NO_SUCH_ENTRY
```

The entry does not exist.

<br />

Constant Value:

1
(0x00000001)


### STATUS_OK

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

```
public static final int STATUS_OK
```

Value was successfully retrieved.

<br />

Constant Value:

0
(0x00000000)


### STATUS_READER_AUTHENTICATION_FAILED

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

```
public static final int STATUS_READER_AUTHENTICATION_FAILED
```

The entry was not retrieved because reader authentication failed.

<br />

Constant Value:

5
(0x00000005)


### STATUS_USER_AUTHENTICATION_FAILED

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

```
public static final int STATUS_USER_AUTHENTICATION_FAILED
```

The entry was not retrieved because user authentication failed.

<br />

Constant Value:

4
(0x00000004)


## Public methods

### getAuthenticatedData

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

```
public abstract byte[] getAuthenticatedData ()
```


**This method is deprecated.**   

Use `java.security.KeyStore` with the Android hardware-backed keystore
instead.

Returns a CBOR structure containing the retrieved data.

This structure - along with the session transcript - may be cryptographically
authenticated to prove to the reader that the data is from a trusted credential and
`https://developer.android.com/reference/android/security/identity/ResultData#getMessageAuthenticationCode()` can be used to get a MAC.

The CBOR structure which is cryptographically authenticated is the
`DeviceAuthenticationBytes` structure according to the following
[CDDL](https://tools.ietf.org/html/rfc8610) schema:

```
  DeviceAuthentication = [
    "DeviceAuthentication",
    SessionTranscript,
    DocType,
    DeviceNameSpacesBytes
  ]

  DocType = tstr
  SessionTranscript = any
  DeviceNameSpacesBytes = #6.24(bstr .cbor DeviceNameSpaces)
  DeviceAuthenticationBytes = #6.24(bstr .cbor DeviceAuthentication)
```

where

```
  DeviceNameSpaces = {
    * NameSpace => DeviceSignedItems
  }

  DeviceSignedItems = {
    + DataItemName => DataItemValue
  }

  NameSpace = tstr
  DataItemName = tstr
  DataItemValue = any
```

The returned data is the binary encoding of the `DeviceNameSpaces` structure
as defined above.

<br />

| Returns ||
|---|---|
| `byte[]` | The bytes of the `DeviceNameSpaces` CBOR structure. This value cannot be `null`. <br /> |

### getEntry

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

```
public abstract byte[] getEntry (String namespaceName, 
                String name)
```


**This method is deprecated.**   

Use `java.security.KeyStore` with the Android hardware-backed keystore
instead.

Gets the raw CBOR data for the value of an entry.

This should only be called on an entry for which the `https://developer.android.com/reference/android/security/identity/ResultData#getStatus(java.lang.String,%20java.lang.String)`
method returns `https://developer.android.com/reference/android/security/identity/ResultData#STATUS_OK`.

<br />

| Parameters ||
|---|---|
| `namespaceName` | `String`: the namespace name of the entry. This value cannot be `null`. <br /> |
| `name` | `String`: the name of the entry to get the value for. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `byte[]` | the raw CBOR data or `null` if no entry with the given name exists. <br /> |

### getEntryNames

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

```
public abstract Collection<String> getEntryNames (String namespaceName)
```


**This method is deprecated.**   

Use `java.security.KeyStore` with the Android hardware-backed keystore
instead.

Get the names of all entries.

This includes the name of entries that wasn't successfully retrieved.

<br />

| Parameters ||
|---|---|
| `namespaceName` | `String`: the namespace name to get entries for. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Collection<https://developer.android.com/reference/java/lang/String>` | A collection of names or `null` if there are no entries for the given namespace. <br /> |

### getMessageAuthenticationCode

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

```
public abstract byte[] getMessageAuthenticationCode ()
```


**This method is deprecated.**   

Use `java.security.KeyStore` with the Android hardware-backed keystore
instead.

Returns a message authentication code over the `DeviceAuthenticationBytes` CBOR
specified in `https://developer.android.com/reference/android/security/identity/ResultData#getAuthenticatedData()`, to prove to the reader that the data
is from a trusted credential.

The MAC proves to the reader that the data is from a trusted credential. This code is
produced by using the key agreement and key derivation function from the ciphersuite
with the authentication private key and the reader ephemeral public key to compute a
shared message authentication code (MAC) key, then using the MAC function from the
ciphersuite to compute a MAC of the authenticated data. See section 9.2.3.5 of
ISO/IEC 18013-5 for details of this operation.

If the `sessionTranscript` parameter passed to
`https://developer.android.com/reference/android/security/identity/IdentityCredential#getEntries(byte[],%20java.util.Map<java.lang.String,java.util.Collection<java.lang.String>>,%20byte[],%20byte[])` was `null`
or the reader ephmeral public key was never set using
`https://developer.android.com/reference/android/security/identity/IdentityCredential#setReaderEphemeralPublicKey(java.security.PublicKey)`, no message
authencation code will be produced and this method will return `null`.

<br />

| Returns ||
|---|---|
| `byte[]` | A COSE_Mac0 structure with the message authentication code as described above or `null` if the conditions specified above are not met. <br /> |

### getNamespaces

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

```
public abstract Collection<String> getNamespaces ()
```


**This method is deprecated.**   

Use `java.security.KeyStore` with the Android hardware-backed keystore
instead.

Gets the names of namespaces with retrieved entries.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Collection<https://developer.android.com/reference/java/lang/String>` | collection of name of namespaces containing retrieved entries. May be empty if no data was retrieved. This value cannot be `null`. <br /> |

### getRetrievedEntryNames

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

```
public abstract Collection<String> getRetrievedEntryNames (String namespaceName)
```


**This method is deprecated.**   

Use `java.security.KeyStore` with the Android hardware-backed keystore
instead.

Get the names of all entries that was successfully retrieved.

This only return entries for which `https://developer.android.com/reference/android/security/identity/ResultData#getStatus(java.lang.String,%20java.lang.String)` will return
`https://developer.android.com/reference/android/security/identity/ResultData#STATUS_OK`.

<br />

| Parameters ||
|---|---|
| `namespaceName` | `String`: the namespace name to get entries for. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Collection<https://developer.android.com/reference/java/lang/String>` | A collection of names or `null` if there are no entries for the given namespace. <br /> |

### getStaticAuthenticationData

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

```
public abstract byte[] getStaticAuthenticationData ()
```


**This method is deprecated.**   

Use `java.security.KeyStore` with the Android hardware-backed keystore
instead.

Returns the static authentication data associated with the dynamic authentication
key used to sign or MAC the data returned by `https://developer.android.com/reference/android/security/identity/ResultData#getAuthenticatedData()`.

<br />

| Returns ||
|---|---|
| `byte[]` | The static authentication data associated with dynamic authentication key used to MAC the data. This value cannot be `null`. <br /> |

### getStatus

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

```
public abstract int getStatus (String namespaceName, 
                String name)
```


**This method is deprecated.**   

Use `java.security.KeyStore` with the Android hardware-backed keystore
instead.

Gets the status of an entry.

This returns `https://developer.android.com/reference/android/security/identity/ResultData#STATUS_OK` if the value was retrieved, `https://developer.android.com/reference/android/security/identity/ResultData#STATUS_NO_SUCH_ENTRY`
if the given entry wasn't retrieved, `https://developer.android.com/reference/android/security/identity/ResultData#STATUS_NOT_REQUESTED` if it wasn't requested,
`https://developer.android.com/reference/android/security/identity/ResultData#STATUS_NOT_IN_REQUEST_MESSAGE` if the request message was set but the entry wasn't
present in the request message, `https://developer.android.com/reference/android/security/identity/ResultData#STATUS_USER_AUTHENTICATION_FAILED` if the value
wasn't retrieved because the necessary user authentication wasn't performed,
`https://developer.android.com/reference/android/security/identity/ResultData#STATUS_READER_AUTHENTICATION_FAILED` if the supplied reader certificate chain didn't
match the set of certificates the entry was provisioned with, or
`https://developer.android.com/reference/android/security/identity/ResultData#STATUS_NO_ACCESS_CONTROL_PROFILES` if the entry was configured without any access
control profiles.

<br />

| Parameters ||
|---|---|
| `namespaceName` | `String`: the namespace name of the entry. This value cannot be `null`. <br /> |
| `name` | `String`: the name of the entry to get the value for. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `int` | the status indicating whether the value was retrieved and if not, why. Value is one of the following: - `https://developer.android.com/reference/android/security/identity/ResultData#STATUS_OK` - `https://developer.android.com/reference/android/security/identity/ResultData#STATUS_NO_SUCH_ENTRY` - `https://developer.android.com/reference/android/security/identity/ResultData#STATUS_NOT_REQUESTED` - `https://developer.android.com/reference/android/security/identity/ResultData#STATUS_NOT_IN_REQUEST_MESSAGE` - `https://developer.android.com/reference/android/security/identity/ResultData#STATUS_USER_AUTHENTICATION_FAILED` - `https://developer.android.com/reference/android/security/identity/ResultData#STATUS_READER_AUTHENTICATION_FAILED` - `https://developer.android.com/reference/android/security/identity/ResultData#STATUS_NO_ACCESS_CONTROL_PROFILES` |