Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
IntegrityManager
public
interface
IntegrityManager
com.google.android.play.core.integrity.IntegrityManager
|
Gestisce le richieste di informazioni sull'integrità.
Riepilogo
Metodi pubblici
requestIntegrityToken
public abstract Task<IntegrityTokenResponse> requestIntegrityToken (IntegrityTokenRequest request)
Genera e restituisce un token per le richieste relative all'integrità.
Il payload JSON viene firmato e criptato come JWT nidificato, ovvero JWE di JWS.
JWE utilizza A256KW come algoritmo di wrapping della chiave e A256GCM come algoritmo di crittografia dei contenuti. JWS utilizza ES256 come algoritmo di firma.
Tutta la decriptografia e la verifica devono essere eseguite in un ambiente server sicuro. Non decriptare o verificare il token ricevuto dall'app client. In particolare, non esporre mai
le chiavi di decriptazione all'app client.
Consulta la pagina https://developer.android.com/google/play/integrity/verdict#token-format.
Parametri |
request |
IntegrityTokenRequest : l'oggetto con cui richiedere il token di integrità. |
I campioni di contenuti e codice in questa pagina sono soggetti alle licenze descritte nella Licenza per i contenuti. Java e OpenJDK sono marchi o marchi registrati di Oracle e/o delle sue società consociate.
Ultimo aggiornamento 2025-08-29 UTC.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-08-29 UTC."],[],[],null,["IntegrityManager\n\n\n`\npublic\n\n\ninterface\nIntegrityManager\n`\n\n\n`\n\n\n`\n\n|---------------------------------------------------------|\n| com.google.android.play.core.integrity.IntegrityManager |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nManages requests for integrity information.\n\nSummary\n\n| Public methods ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract `[Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`\u003c`[IntegrityTokenResponse](../../../../../../../reference/com/google/android/play/core/integrity/IntegrityTokenResponse.html)`\u003e` | ` `[requestIntegrityToken](../../../../../../../reference/com/google/android/play/core/integrity/IntegrityManager.html#requestIntegrityToken(com.google.android.play.core.integrity.IntegrityTokenRequest))`(`[IntegrityTokenRequest](../../../../../../../reference/com/google/android/play/core/integrity/IntegrityTokenRequest.html)` request) ` Generates and returns a token for integrity-related enquiries. |\n| ` abstract `[Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`\u003c`[Integer](https://developer.android.com/reference/java/lang/Integer.html)`\u003e` | ` `[showDialog](../../../../../../../reference/com/google/android/play/core/integrity/IntegrityManager.html#showDialog(com.google.android.play.core.integrity.IntegrityDialogRequest))`(`[IntegrityDialogRequest](../../../../../../../reference/com/google/android/play/core/integrity/IntegrityDialogRequest.html)` request) ` Displays a dialog to the user. |\n\nPublic methods \n\nrequestIntegrityToken \n\n```\npublic abstract Task\u003cIntegrityTokenResponse\u003e requestIntegrityToken (IntegrityTokenRequest request)\n```\n\nGenerates and returns a token for integrity-related enquiries.\n\nThe JSON payload is signed and encrypted as a nested JWT, that is [JWE](https://tools.ietf.org/html/rfc7516) of [JWS](https://tools.ietf.org/html/rfc7515).\n\nJWE uses [A256KW](https://tools.ietf.org/html/rfc7518#section-4.4) as a key\nwrapping algorithm and [A256GCM](https://tools.ietf.org/html/rfc7518#section-5.3) as\na content encryption algorithm. JWS uses [ES256](https://tools.ietf.org/html/rfc7518#section-3.4) as a signing algorithm.\n\nAll decryption and verification should be done within a secure server environment. Do not\ndecrypt or verify the received token from within the client app. In particular, never expose\nany decryption keys to the client app.\n\nSee https://developer.android.com/google/play/integrity/verdict#token-format.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------|-----------------------------------------------------------------------------|\n| `request` | `IntegrityTokenRequest`: the object to request integrity token with. \u003cbr /\u003e |\n\n| Returns ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`\u003c`[IntegrityTokenResponse](../../../../../../../reference/com/google/android/play/core/integrity/IntegrityTokenResponse.html)`\u003e` | A [Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html) that completes once the requestIntegrityToken flow succeeded or failed. \u003cbr /\u003e |\n\nshowDialog \n\n```\npublic abstract Task\u003cInteger\u003e showDialog (IntegrityDialogRequest request)\n```\n\nDisplays a dialog to the user.\n\nThis method can only be called once per [IntegrityDialogRequest.IntegrityResponse](../../../../../../../reference/com/google/android/play/core/integrity/IntegrityDialogRequest.IntegrityResponse.html).\n\n| Parameters ||\n|-----------|-----------------------------------------------------------------------------------------|\n| `request` | `IntegrityDialogRequest`: contains the configuration for the dialog to be shown. \u003cbr /\u003e |\n\n| Returns ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`\u003c`[Integer](https://developer.android.com/reference/java/lang/Integer.html)`\u003e` | A [Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html) that completes with a [IntegrityDialogResponseCode](https://developer.android.com/android/reference/com/google/android/play/core/integrity/model/IntegrityDialogResponseCode) once the showDialog flow succeeded or failed. \u003cbr /\u003e |"]]