Package: android.hardware.confirmationui@1.0

IConfirmationResultCallback

interface IConfirmationResultCallback

Callback interface passed to IConfirmationUI::promptUserConfirmation().Informs the caller about the result of the prompt operation.

Methods

result

result (ResponseCode error, vec<uint8_t> formattedMessage, vec<uint8_t> confirmationToken)

This callback is called by the confirmation provider when it stops prompting the user.Iff the user has confirmed the prompted text, error is ErrorCode::OK and the parameters formattedMessage and confirmationToken hold the values needed to request a signature from keymaster.In all other cases formattedMessage and confirmationToken must be of length 0.

Details
Parameters
error
- OK:IFF the user has confirmed the prompt.- Canceled:If the user has pressed the cancel button.- Aborted:If IConfirmationUI::abort() was called.- SystemError:If an unexpected System error occurred that prevented the TUI from being shut down gracefully.
formattedMessage
holds the prompt text and extra data.The message is CBOR(RFC 7049)encoded and has the following format:CBOR_MAP{"prompt" , <promptText>, "extra" , <extraData>} The message is a CBOR encoded map(type 5)with the keys "prompt" and "extra".The keys are encoded as CBOR text string(type 3). The value<promptText>is encoded as CBOR text string(type 3), and the value<extraData>is encoded as CBOR byte string(type 2). The map must have exactly one key value pair for each of the keys "prompt" and "extra".Other keys are not allowed.The value of "prompt" is given by the proptText argument to IConfirmationUI::promptUserConfirmation and must not be modified by the implementation.The value of "extra" is given by the extraData argument to IConfirmationUI::promptUserConfirmation and must not be modified or interpreted by the implementation.
confirmationToken
a 32-byte HMAC-SHA256 value, computed over "confirmation token" ||<formattedMessage>i.e.the literal UTF-8 encoded string "confirmation token", without the "", concatenated with the formatted message as returned in the formattedMessage argument.The HMAC is keyed with a 256-bit secret which is shared with Keymaster.In test mode the test key MUST be used(see types.hal TestModeCommands and TestKeyBits).