IntegrityManager

public interface IntegrityManager


Manages requests for integrity information.

Summary

Public methods

abstract Task<IntegrityTokenResponse>

Generates and returns a token for integrity-related enquiries.

abstract Task<Integer>

Displays a dialog to the user.

Public methods

requestIntegrityToken

abstract Task<IntegrityTokenResponserequestIntegrityToken(IntegrityTokenRequest request)

Generates and returns a token for integrity-related enquiries.

The JSON payload is signed and encrypted as a nested JWT, that is JWE of JWS.

JWE uses A256KW as a key wrapping algorithm and A256GCM as a content encryption algorithm. JWS uses ES256 as a signing algorithm.

All decryption and verification should be done within a secure server environment. Do not decrypt or verify the received token from within the client app. In particular, never expose any decryption keys to the client app.

See https://developer.android.com/google/play/integrity/verdict#token-format.

Parameters
IntegrityTokenRequest request

the object to request integrity token with.

Returns
Task<IntegrityTokenResponse>

A Task that completes once the requestIntegrityToken flow succeeded or failed.

showDialog

abstract Task<IntegershowDialog(IntegrityDialogRequest request)

Displays a dialog to the user.

This method can only be called once per IntegrityDialogRequest.IntegrityResponse.

Note: Added in library version 1.5.0.

Since 1.5.0

Parameters
IntegrityDialogRequest request

contains the configuration for the dialog to be shown.

Returns
Task<Integer>

A Task that completes with a IntegrityDialogResponseCode once the showDialog flow succeeded or failed.