Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
IntegrityManager
public
interface
IntegrityManager
com.google.android.play.core.integrity.IntegrityManager
|
Mengelola permintaan informasi integritas.
Ringkasan
Metode publik
requestIntegrityToken
public abstract Task<IntegrityTokenResponse> requestIntegrityToken (IntegrityTokenRequest request)
Menghasilkan dan menampilkan token untuk pertanyaan terkait integritas.
Payload JSON ditandatangani dan dienkripsi sebagai JWT bertingkat, yaitu JWE dari JWS.
JWE menggunakan A256KW sebagai algoritma
penggabungan kunci dan A256GCM sebagai
algoritma enkripsi konten. JWS menggunakan ES256 sebagai algoritme penandatanganan.
Semua dekripsi dan verifikasi harus dilakukan dalam lingkungan server yang aman. Jangan
mendekripsi atau memverifikasi token yang diterima dari dalam aplikasi klien. Khususnya, jangan pernah menampilkan
kunci dekripsi apa pun ke aplikasi klien.
Lihat https://developer.android.com/google/play/integrity/verdict#token-format.
Parameter |
request |
IntegrityTokenRequest : objek untuk meminta token integritas. |
Konten dan contoh kode di halaman ini tunduk kepada lisensi yang dijelaskan dalam Lisensi Konten. Java dan OpenJDK adalah merek dagang atau merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-08-29 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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 |"]]