Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
IntegrityManager
public
interface
IntegrityManager
com.google.android.play.core.integrity.IntegrityManager
|
Quản lý các yêu cầu cung cấp thông tin về tính toàn vẹn.
Tóm tắt
Phương thức công khai
requestIntegrityToken
public abstract Task<IntegrityTokenResponse> requestIntegrityToken (IntegrityTokenRequest request)
Tạo và trả về mã thông báo cho các yêu cầu có liên quan đến tính toàn vẹn.
Tải trọng JSON được ký và mã hóa dưới dạng JWT lồng nhau, đó là JWE của JWS.
JWE sử dụng A256KW làm thuật toán gói mã khóa và A256GCM làm thuật toán mã hoá nội dung. JWS sử dụng ES256 làm thuật toán ký.
Bạn phải thực hiện toàn bộ quá trình giải mã và xác minh trong môi trường máy chủ bảo mật. Không được giải mã hoặc xác minh mã thông báo nhận được từ trong ứng dụng khách. Cụ thể là đừng bao giờ để lộ khoá giải mã nào cho ứng dụng khách.
Hãy truy cập https://developer.android.com/google/play/integrity/verdict#token-format.
Các tham số |
request |
IntegrityTokenRequest : đối tượng để yêu cầu mã thông báo tính toàn vẹn. |
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[],[],null,["# IntegrityManager\n================\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\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\nPublic methods\n--------------\n\n### requestIntegrityToken\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 |"]]