透過集合功能整理內容
你可以依據偏好儲存及分類內容。
IntegrityManager
public
interface
IntegrityManager
com.google.android.play.core.integrity.IntegrityManager
|
管理完整性資訊的要求。
摘要
公用方法
requestIntegrityToken
public abstract Task<IntegrityTokenResponse> requestIntegrityToken (IntegrityTokenRequest request)
產生並傳回完整性相關查詢的權杖。
JSON 酬載是以巢狀 JWT 的形式簽署及加密,JWT 就是 JWS 的 JWE。
JWE 分別使用 A256KW 和 A256GCM,做為金鑰包裝和內容加密演算法。JWS 則使用 ES256 做為簽署演算法。
所有解密及驗證作業都應在安全的伺服器環境中完成。請不要在用戶端應用程式中解密或驗證收到的權杖,也切勿將解密金鑰提供給用戶端應用程式。
詳情請參閱 https://developer.android.com/google/play/integrity/verdict#token-format。
參數 |
request |
IntegrityTokenRequest :用於要求完整性權杖的物件。 |
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-08-29 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-08-29 (世界標準時間)。"],[],[],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 |"]]