ResultData

public abstract class ResultData
extends Object

java.lang.Object
   ↳ androidx.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

int STATUS_NOT_IN_REQUEST_MESSAGE

Requested entry wasn't in the request message.

int STATUS_NOT_REQUESTED

Requested entry was not requested.

int STATUS_NO_ACCESS_CONTROL_PROFILES

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

int STATUS_NO_SUCH_ENTRY

Requested entry does not exist.

int STATUS_OK

Value was successfully retrieved.

int STATUS_READER_AUTHENTICATION_FAILED

The requested entry was not retrieved because reader authentication wasn't performed.

int STATUS_USER_AUTHENTICATION_FAILED

The requested entry was not retrieved because user authentication wasn't performed.

Public methods

abstract byte[] getAuthenticatedData()

Returns a CBOR structure containing the retrieved data.

abstract byte[] getEcdsaSignature()

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

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

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

boolean getEntryBoolean(String namespaceName, String name)

Gets the value of an entry.

byte[] getEntryBytestring(String namespaceName, String name)

Gets the value of an entry.

Calendar getEntryCalendar(String namespaceName, String name)

Gets the value of an entry.

long getEntryInteger(String namespaceName, String name)

Gets the value of an entry.

abstract Collection<String> getEntryNames(String namespaceName)

Get the names of all entries.

String getEntryString(String namespaceName, String name)

Gets the value of an entry.

abstract byte[] getMessageAuthenticationCode()

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 Collection<String> getNamespaces()

Gets the names of namespaces with retrieved entries.

abstract Collection<String> getRetrievedEntryNames(String namespaceName)

Get the names of all entries that was successfully retrieved.

abstract byte[] getStaticAuthenticationData()

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

abstract int getStatus(String namespaceName, String name)

Gets the status of an entry.

Inherited methods

Constants

STATUS_NOT_IN_REQUEST_MESSAGE

public static final int STATUS_NOT_IN_REQUEST_MESSAGE

Requested entry wasn't in the request message.

Constant Value: 3 (0x00000003)

STATUS_NOT_REQUESTED

public static final int STATUS_NOT_REQUESTED

Requested entry was not requested.

Constant Value: 2 (0x00000002)

STATUS_NO_ACCESS_CONTROL_PROFILES

public static final int STATUS_NO_ACCESS_CONTROL_PROFILES

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

Constant Value: 6 (0x00000006)

STATUS_NO_SUCH_ENTRY

public static final int STATUS_NO_SUCH_ENTRY

Requested entry does not exist.

Constant Value: 1 (0x00000001)

STATUS_OK

public static final int STATUS_OK

Value was successfully retrieved.

Constant Value: 0 (0x00000000)

STATUS_READER_AUTHENTICATION_FAILED

public static final int STATUS_READER_AUTHENTICATION_FAILED

The requested entry was not retrieved because reader authentication wasn't performed.

Constant Value: 5 (0x00000005)

STATUS_USER_AUTHENTICATION_FAILED

public static final int STATUS_USER_AUTHENTICATION_FAILED

The requested entry was not retrieved because user authentication wasn't performed.

Constant Value: 4 (0x00000004)

Public methods

getAuthenticatedData

public abstract byte[] getAuthenticatedData ()

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.

Returns
byte[] The bytes of the DeviceNameSpaces CBOR structure.

getEcdsaSignature

public abstract byte[] getEcdsaSignature ()

Returns a digital signature over the DeviceAuthenticationBytes CBOR specified in getAuthenticatedData()