Added in API level 30
Deprecated in API level 33

ResultData


abstract class ResultData
kotlin.Any
   ↳ android.security.identity.ResultData

An object that contains the result of retrieving data from a credential. This is used to return data requested from a IdentityCredential.

Summary

Constants
static Int

The entry wasn't in the request message.

static Int

The entry was not requested.

static Int

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

static Int

The entry does not exist.

static Int

Value was successfully retrieved.

static Int

The entry was not retrieved because reader authentication failed.

static Int

The entry was not retrieved because user authentication failed.

Public methods
abstract ByteArray

Returns a CBOR structure containing the retrieved data.

abstract ByteArray?
getEntry(namespaceName: String, name: String)

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

abstract MutableCollection<String!>?
getEntryNames(namespaceName: String)

Get the names of all entries.

abstract ByteArray?

Returns a message authentication code over the DeviceAuthenticationBytes CBOR specified in getAuthenticatedData(), to prove to the reader that the data is from a trusted credential.

abstract MutableCollection<String!>

Gets the names of namespaces with retrieved entries.

abstract MutableCollection<String!>?

Get the names of all entries that was successfully retrieved.

abstract ByteArray

Returns the static authentication data associated with the dynamic authentication key used to sign or MAC the data returned by getAuthenticatedData().

abstract Int
getStatus(namespaceName: String, name: String)

Gets the status of an entry.

Constants

STATUS_NOT_IN_REQUEST_MESSAGE

Added in API level 30
static val STATUS_NOT_IN_REQUEST_MESSAGE: Int

Deprecated: Deprecated in Java.

The entry wasn't in the request message.

Value: 3

STATUS_NOT_REQUESTED

Added in API level 30
static val STATUS_NOT_REQUESTED: Int

Deprecated: Deprecated in Java.

The entry was not requested.

Value: 2

STATUS_NO_ACCESS_CONTROL_PROFILES

Added in API level 30
static val STATUS_NO_ACCESS_CONTROL_PROFILES: Int

Deprecated: Deprecated in Java.

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

Value: 6

STATUS_NO_SUCH_ENTRY

Added in API level 30
static val STATUS_NO_SUCH_ENTRY: Int

Deprecated: Deprecated in Java.

The entry does not exist.

Value: 1

STATUS_OK

Added in API level 30
static val STATUS_OK: Int

Deprecated: Deprecated in Java.

Value was successfully retrieved.

Value: 0

STATUS_READER_AUTHENTICATION_FAILED

Added in API level 30
static val STATUS_READER_AUTHENTICATION_FAILED: Int

Deprecated: Deprecated in Java.

The entry was not retrieved because reader authentication failed.

Value: 5

STATUS_USER_AUTHENTICATION_FAILED

Added in API level 30
static val STATUS_USER_AUTHENTICATION_FAILED: Int

Deprecated: Deprecated in Java.

The entry was not retrieved because user authentication failed.

Value: 4

Public methods

getAuthenticatedData

Added in API level 30
abstract fun getAuthenticatedData(): ByteArray

Deprecated: Deprecated in Java.

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 getMessageAuthenticationCode() can be used to get a MAC.

The CBOR structure which is cryptographically authenticated is the DeviceAuthenticationBytes structure according to the following CDDL 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.

Return
ByteArray The bytes of the DeviceNameSpaces CBOR structure. This value cannot be null.

getEntry

Added in API level 30
abstract fun getEntry(
    namespaceName: String,
    name: String
): ByteArray?

Deprecated: Deprecated in Java.

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

This should only be called on an entry for which the getStatus(java.lang.String,java.lang.String) method returns STATUS_OK.

Parameters
namespaceName String: the namespace name of the entry. This value cannot be null.
name String: the name of the entry to get the value for. This value cannot be null.
Return
ByteArray? the raw CBOR data or null if no entry with the given name exists.

getEntryNames

Added in API level 30
abstract fun getEntryNames(namespaceName: String): MutableCollection<String!>?

Deprecated: Deprecated in Java.

Get the names of all entries.

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

Parameters
namespaceName String: the namespace name to get entries for. This value cannot be null.
Return
MutableCollection<String!>? A collection of names or null if there are no entries for the given namespace.

getMessageAuthenticationCode

Added in API level 30
abstract fun getMessageAuthenticationCode(): ByteArray?

Deprecated: Deprecated in Java.

Returns a message authentication code over the DeviceAuthenticationBytes CBOR specified in 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 android.security.identity.IdentityCredential#getEntries(byte[],Map,byte[],byte[]) was null or the reader ephmeral public key was never set using android.security.identity.IdentityCredential#setReaderEphemeralPublicKey(PublicKey), no message authencation code will be produced and this method will return null.

Return
ByteArray? A COSE_Mac0 structure with the message authentication code as described above or null if the conditions specified above are not met.

getNamespaces

Added in API level 30
abstract fun getNamespaces(): MutableCollection<String!>

Deprecated: Deprecated in Java.

Gets the names of namespaces with retrieved entries.

Return
MutableCollection<String!> collection of name of namespaces containing retrieved entries. May be empty if no data was retrieved. This value cannot be null.

getRetrievedEntryNames

Added in API level 30
abstract fun getRetrievedEntryNames(namespaceName: String): MutableCollection<String!>?

Deprecated: Deprecated in Java.

Get the names of all entries that was successfully retrieved.

This only return entries for which getStatus(java.lang.String,java.lang.String) will return STATUS_OK.

Parameters
namespaceName String: the namespace name to get entries for. This value cannot be null.
Return
MutableCollection<String!>? A collection of names or null if there are no entries for the given namespace.

getStaticAuthenticationData

Added in API level 30
abstract fun getStaticAuthenticationData(): ByteArray

Deprecated: Deprecated in Java.

Returns the static authentication data associated with the dynamic authentication key used to sign or MAC the data returned by getAuthenticatedData().

Return
ByteArray The static authentication data associated with dynamic authentication key used to MAC the data. This value cannot be null.

getStatus

Added in API level 30
abstract fun getStatus(
    namespaceName: String,
    name: String
): Int

Deprecated: Deprecated in Java.

Gets the status of an entry.

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

Parameters
namespaceName String: the namespace name of the entry. This value cannot be null.
name String: the name of the entry to get the value for. This value cannot be null.
Return
Int the status indicating whether the value was retrieved and if not, why. Value is android.security.identity.ResultData#STATUS_OK, android.security.identity.ResultData#STATUS_NO_SUCH_ENTRY, android.security.identity.ResultData#STATUS_NOT_REQUESTED, android.security.identity.ResultData#STATUS_NOT_IN_REQUEST_MESSAGE, android.security.identity.ResultData#STATUS_USER_AUTHENTICATION_FAILED, android.security.identity.ResultData#STATUS_READER_AUTHENTICATION_FAILED, or android.security.identity.ResultData#STATUS_NO_ACCESS_CONTROL_PROFILES