Class ResultData
- java.lang.Object
-
- com.android.identity.ResultData
-
@Deprecated public abstract class ResultData extends java.lang.Object
Deprecated.UsePresentationSession
instead.An object that contains the result of retrieving data from a credential. This is used to return data requested from aIdentityCredential
.
-
-
Field Summary
Fields Modifier and Type Field Description static int
STATUS_NO_ACCESS_CONTROL_PROFILES
Deprecated.The requested entry was not retrieved because it was configured without any access control profile.static int
STATUS_NO_SUCH_ENTRY
Deprecated.Requested entry does not exist.static int
STATUS_NOT_IN_REQUEST_MESSAGE
Deprecated.Requested entry wasn't in the request message.static int
STATUS_NOT_REQUESTED
Deprecated.Requested entry was not requested.static int
STATUS_OK
Deprecated.Value was successfully retrieved.static int
STATUS_READER_AUTHENTICATION_FAILED
Deprecated.The requested entry was not retrieved because reader authentication wasn't performed.static int
STATUS_USER_AUTHENTICATION_FAILED
Deprecated.The requested entry was not retrieved because user authentication wasn't performed.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract byte[]
getAuthenticatedData()
Deprecated.Returns a CBOR structure containing the retrieved data.abstract byte[]
getEcdsaSignature()
Deprecated.Returns a digital signature over theDeviceAuthenticationBytes
CBOR specified ingetAuthenticatedData()
, to prove to the reader that the data is from a trusted credential.abstract byte[]
getEntry(java.lang.String namespaceName, java.lang.String name)
Deprecated.Gets the raw CBOR data for the value of an entry.boolean
getEntryBoolean(java.lang.String namespaceName, java.lang.String name)
Deprecated.Gets the value of an entry.byte[]
getEntryBytestring(java.lang.String namespaceName, java.lang.String name)
Deprecated.Gets the value of an entry.android.icu.util.Calendar
getEntryCalendar(java.lang.String namespaceName, java.lang.String name)
Deprecated.Gets the value of an entry.long
getEntryInteger(java.lang.String namespaceName, java.lang.String name)
Deprecated.Gets the value of an entry.abstract java.util.Collection<java.lang.String>
getEntryNames(java.lang.String namespaceName)
Deprecated.Get the names of all entries.java.lang.String
getEntryString(java.lang.String namespaceName, java.lang.String name)
Deprecated.Gets the value of an entry.abstract byte[]
getMessageAuthenticationCode()
Deprecated.Returns a message authentication code over theDeviceAuthenticationBytes
CBOR specified ingetAuthenticatedData()
, to prove to the reader that the data is from a trusted credential.abstract java.util.Collection<java.lang.String>
getNamespaces()
Deprecated.Gets the names of namespaces with retrieved entries.abstract java.util.Collection<java.lang.String>
getRetrievedEntryNames(java.lang.String namespaceName)
Deprecated.Get the names of all entries that was successfully retrieved.abstract byte[]
getStaticAuthenticationData()
Deprecated.Returns the static authentication data associated with the dynamic authentication key used to sign or MAC the data returned bygetAuthenticatedData()
.abstract int
getStatus(java.lang.String namespaceName, java.lang.String name)
Deprecated.Gets the status of an entry.
-
-
-
Field Detail
-
STATUS_OK
public static final int STATUS_OK
Deprecated.Value was successfully retrieved.- See Also:
- Constant Field Values
-
STATUS_NO_SUCH_ENTRY
public static final int STATUS_NO_SUCH_ENTRY
Deprecated.Requested entry does not exist.- See Also:
- Constant Field Values
-
STATUS_NOT_REQUESTED
public static final int STATUS_NOT_REQUESTED
Deprecated.Requested entry was not requested.- See Also:
- Constant Field Values
-
STATUS_NOT_IN_REQUEST_MESSAGE
public static final int STATUS_NOT_IN_REQUEST_MESSAGE
Deprecated.Requested entry wasn't in the request message.- See Also:
- Constant Field Values
-
STATUS_USER_AUTHENTICATION_FAILED
public static final int STATUS_USER_AUTHENTICATION_FAILED
Deprecated.The requested entry was not retrieved because user authentication wasn't performed.- See Also:
- Constant Field Values
-
STATUS_READER_AUTHENTICATION_FAILED
public static final int STATUS_READER_AUTHENTICATION_FAILED
Deprecated.The requested entry was not retrieved because reader authentication wasn't performed.- See Also:
- Constant Field Values
-
STATUS_NO_ACCESS_CONTROL_PROFILES
public static final int STATUS_NO_ACCESS_CONTROL_PROFILES
Deprecated.The requested entry was not retrieved because it was configured without any access control profile.- See Also:
- Constant Field Values
-
-
Method Detail
-
getAuthenticatedData
@NonNull public abstract byte[] getAuthenticatedData()
Deprecated.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:
- The bytes of the
DeviceNameSpaces
CBOR structure.
-
getMessageAuthenticationCode
@Nullable public abstract byte[] getMessageAuthenticationCode()
Deprecated.Returns a message authentication code over theDeviceAuthenticationBytes
CBOR specified ingetAuthenticatedData()
, 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 toIdentityCredential.getEntries(byte[], Map, byte[])
wasnull
or the reader ephmeral public key was never set usingIdentityCredential.setReaderEphemeralPublicKey(PublicKey)
, no message authencation code will be produced and this method will returnnull
. At most one ofgetMessageAuthenticationCode()
orgetEcdsaSignature()
is implemented.- Returns:
- A COSE_Mac0 structure with the message authentication code as described above
or
null
if the conditions specified above are not met.
-
getEcdsaSignature
@Nullable public abstract byte[] getEcdsaSignature()
Deprecated.Returns a digital signature over theDeviceAuthenticationBytes
CBOR specified ingetAuthenticatedData()
, to prove to the reader that the data is from a trusted credential. The signature will be made with one of the provisioned dynamic authentication keys. At most one ofgetMessageAuthenticationCode()
orgetEcdsaSignature()
is implemented.- Returns:
null
if not implemented, otherwise a COSE_Sign1 structure with the payload set to the data returned bygetAuthenticatedData()
.
-
getStaticAuthenticationData
@NonNull public abstract byte[] getStaticAuthenticationData()
Deprecated.Returns the static authentication data associated with the dynamic authentication key used to sign or MAC the data returned bygetAuthenticatedData()
.- Returns:
- The static authentication data associated with dynamic authentication key used to MAC the data.
-
getNamespaces
@NonNull public abstract java.util.Collection<java.lang.String> getNamespaces()
Deprecated.Gets the names of namespaces with retrieved entries.- Returns:
- collection of name of namespaces containing retrieved entries. May be empty if no data was retrieved.
-
getEntryNames
@Nullable public abstract java.util.Collection<java.lang.String> getEntryNames(@NonNull java.lang.String namespaceName)
Deprecated.Get the names of all entries. This includes the name of entries that wasn't successfully retrieved.- Parameters:
namespaceName
- the namespace name to get entries for.- Returns:
- A collection of names or
null
if there are no entries for the given namespace.
-
getRetrievedEntryNames
@Nullable public abstract java.util.Collection<java.lang.String> getRetrievedEntryNames(@NonNull java.lang.String namespaceName)
Deprecated.Get the names of all entries that was successfully retrieved. This only return entries for whichgetStatus(String, String)
will returnSTATUS_OK
.- Parameters:
namespaceName
- the namespace name to get entries for.- Returns:
- A collection of names or
null
if there are no entries for the given namespace.
-
getStatus
public abstract int getStatus(@NonNull java.lang.String namespaceName, @NonNull java.lang.String name)
Deprecated.Gets the status of an entry. This returnsSTATUS_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, orSTATUS_NO_ACCESS_CONTROL_PROFILES
if the entry was configured without any access control profiles.- Parameters:
namespaceName
- the namespace name of the entry.name
- the name of the entry to get the value for.- Returns:
- the status indicating whether the value was retrieved and if not, why.
-
getEntry
@Nullable public abstract byte[] getEntry(@NonNull java.lang.String namespaceName, @NonNull java.lang.String name)
Deprecated.Gets the raw CBOR data for the value of an entry. This should only be called on an entry for which thegetStatus(String, String)
method returnsSTATUS_OK
.- Parameters:
namespaceName
- the namespace name of the entry.name
- the name of the entry to get the value for.- Returns:
- the raw CBOR data or
null
if no entry with the given name exists.
-
getEntryString
@Nullable public java.lang.String getEntryString(@NonNull java.lang.String namespaceName, @NonNull java.lang.String name)
Deprecated.Gets the value of an entry. This should only be called on an entry for which thegetStatus(String, String)
method returnsSTATUS_OK
.- Parameters:
namespaceName
- the namespace name of the entry.name
- the name of the entry to get the value for.- Returns:
- a
String
ornull
if no entry with the given name exists.
-
getEntryBytestring
@Nullable public byte[] getEntryBytestring(@NonNull java.lang.String namespaceName, @NonNull java.lang.String name)
Deprecated.Gets the value of an entry. This should only be called on an entry for which thegetStatus(String, String)
method returnsSTATUS_OK
.- Parameters:
namespaceName
- the namespace name of the entry.name
- the name of the entry to get the value for.- Returns:
- a
byte[]
ornull
if no entry with the given name exists.
-
getEntryInteger
public long getEntryInteger(@NonNull java.lang.String namespaceName, @NonNull java.lang.String name)
Deprecated.Gets the value of an entry. This should only be called on an entry for which thegetStatus(String, String)
method returnsSTATUS_OK
.- Parameters:
namespaceName
- the namespace name of the entry.name
- the name of the entry to get the value for.- Returns:
- a
long
or 0 if no entry with the given name exists.
-
getEntryBoolean
public boolean getEntryBoolean(@NonNull java.lang.String namespaceName, @NonNull java.lang.String name)
Deprecated.Gets the value of an entry. This should only be called on an entry for which thegetStatus(String, String)
method returnsSTATUS_OK
.- Parameters:
namespaceName
- the namespace name of the entry.name
- the name of the entry to get the value for.- Returns:
- a
boolean
orfalse
if no entry with the given name exists.
-
getEntryCalendar
@Nullable public android.icu.util.Calendar getEntryCalendar(@NonNull java.lang.String namespaceName, @NonNull java.lang.String name)
Deprecated.Gets the value of an entry. This should only be called on an entry for which thegetStatus(String, String)
method returnsSTATUS_OK
.- Parameters:
namespaceName
- the namespace name of the entry.name
- the name of the entry to get the value for.- Returns:
- a
Calendar
ornull
if no entry with the given name exists.
-
-