Xây dựng dịch vụ mã khoá tuỳ chỉnh để dùng tính năng mã hoá phía máy khách
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.
Bạn có thể sử dụng khoá mã hoá của riêng mình để mã hoá dữ liệu của tổ chức thay vì sử dụng quy trình mã hoá do Google Workspace cung cấp. Khi sử dụng tính năng Mã hoá phía máy khách (CSE) của Google Workspace, quá trình mã hoá tệp sẽ được xử lý trong trình duyệt của máy khách trước khi tệp được lưu trữ trong bộ nhớ trên đám mây của Drive. Bằng cách đó, các máy chủ của Google không thể truy cập vào khoá mã hoá của bạn và do đó, không thể giải mã dữ liệu của bạn. Để biết thêm thông tin, hãy xem bài viết Giới thiệu về tính năng mã hoá phía máy khách.
API này cho phép bạn kiểm soát các khoá mã hoá cấp cao nhất giúp bảo vệ dữ liệu của bạn bằng một dịch vụ khoá bên ngoài tuỳ chỉnh. Sau khi bạn tạo một dịch vụ khoá bên ngoài bằng API này, quản trị viên Google Workspace có thể kết nối với dịch vụ đó và bật tính năng CSE cho người dùng.
Thuật ngữ quan trọng
Dưới đây là danh sách các thuật ngữ thường dùng trong Google Workspace Client-side Encryption API:
- Tính năng mã hoá phía máy khách (CSE)
- Mã hoá được xử lý trong trình duyệt của máy khách trước khi được lưu trữ trong bộ nhớ trên đám mây. Điều này giúp bảo vệ tệp khỏi bị nhà cung cấp dịch vụ lưu trữ đọc. Tìm hiểu thêm
- Dịch vụ Danh sách kiểm soát truy cập khoá (KACLS)
- Dịch vụ khoá bên ngoài của bạn sử dụng API này để kiểm soát quyền truy cập vào các khoá mã hoá được lưu trữ trong một hệ thống bên ngoài.
- Nhà cung cấp danh tính (IdP)
- Dịch vụ xác thực người dùng trước khi họ có thể mã hoá tệp hoặc truy cập vào tệp đã mã hoá.
Mã hoá và giải mã
- Khoá mã hoá dữ liệu (DEK)
- Khoá mà Google Workspace sử dụng trong máy khách trình duyệt để mã hoá chính dữ liệu.
- Khoá mã hoá khoá (KEK)
- Khoá từ dịch vụ của bạn dùng để mã hoá Khoá mã hoá dữ liệu (DEK).
Kiểm soát ra vào
- Danh sách kiểm soát quyền truy cập (ACL)
- Danh sách người dùng hoặc nhóm có thể mở hoặc đọc một tệp.
- Mã thông báo web JSON (JWT) xác thực
- Mã thông báo của người mang (JWT: RFC 7516) do đối tác nhận dạng (IdP) phát hành để chứng thực danh tính của người dùng.
- Mã thông báo web JSON (JWT) uỷ quyền
- Mã thông báo của người mang (JWT: RFC 7516) do Google phát hành để xác minh rằng phương thức gọi được phép mã hoá hoặc giải mã một tài nguyên.
- JSON Web Key Set (JWKS)
- URL của điểm cuối chỉ đọc trỏ đến danh sách khoá công khai dùng để xác minh JSON Web Token (JWT).
- Chu vi
- Các bước kiểm tra bổ sung được thực hiện trên mã thông báo xác thực và uỷ quyền trong KACLS để kiểm soát quyền truy cập.
Quy trình mã hoá phía máy khách
Sau khi quản trị viên bật tính năng CSE cho tổ chức của họ, những người dùng được bật tính năng CSE có thể chọn tạo tài liệu được mã hoá bằng các công cụ tạo nội dung cộng tác của Google Workspace (chẳng hạn như Tài liệu và Trang tính) hoặc mã hoá các tệp mà họ tải lên Google Drive (chẳng hạn như tệp PDF).
Sau khi người dùng mã hoá một tài liệu hoặc tệp:
Google Workspace tạo một DEK trong trình duyệt của máy khách để mã hoá nội dung.
Google Workspace gửi DEK và mã thông báo xác thực đến KACLS bên thứ ba của bạn để mã hoá, bằng cách sử dụng một URL mà bạn cung cấp cho quản trị viên của tổ chức Google Workspace.
KACLS của bạn sử dụng API này để mã hoá DEK, sau đó gửi DEK đã mã hoá và làm rối mã nguồn trở lại Google Workspace.
Google Workspace lưu trữ dữ liệu đã được mã hoá và làm rối mã nguồn trên đám mây.
Chỉ những người dùng có quyền truy cập vào KACLS của bạn mới có thể truy cập vào dữ liệu.
Để biết thêm thông tin, hãy xem phần Mã hoá và giải mã tệp.
Các bước tiếp theo
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-08-29 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-29 UTC."],[[["\u003cp\u003eGoogle Workspace Client-side Encryption (CSE) allows you to encrypt your organization's data with your own keys, preventing Google servers from accessing or decrypting it.\u003c/p\u003e\n"],["\u003cp\u003eThis API enables you to manage the encryption keys via an external key service, giving you control over data access.\u003c/p\u003e\n"],["\u003cp\u003eCSE encrypts files in the user's browser before they are stored in Google Drive, ensuring only authorized users with access to your external key service can decrypt them.\u003c/p\u003e\n"],["\u003cp\u003eWhen a file is encrypted, Google Workspace generates a Data Encryption Key (DEK), which is then encrypted by your external key service and stored with the encrypted data.\u003c/p\u003e\n"],["\u003cp\u003eTo get started, you can configure your external key service and learn how to encrypt and decrypt data using the provided guides.\u003c/p\u003e\n"]]],["Google Workspace Client-side Encryption (CSE) allows users to encrypt data in their browser before cloud storage. This is achieved by using your own external Key Access Control List Service (KACLS). Google Workspace generates a Data Encryption Key (DEK) and sends it to your KACLS for encryption with a Key Encryption Key (KEK). Your service then returns the encrypted DEK to Google Workspace. This ensures that only users with KACLS access can decrypt the stored data.\n"],null,["# Build a custom key service for client-side encryption\n\nYou can use your own encryption keys to encrypt your organization's data,\ninstead of using the encryption that Google Workspace provides. With Google Workspace Client-side Encryption (CSE), file encryption is handled in the\nclient's browser before it's stored in Drive's cloud-based storage. That way,\nGoogle servers can't access your encryption keys and, therefore, can't decrypt\nyour data. For more details, see\n[About client-side encryption](https://support.google.com/a/answer/10741897#zippy=%2Cbasic-setup-steps-for-cse).\n\nThis API lets you control the top-level encryption keys that protect your data\nwith a custom external key service. After you create an external key service\nwith this API, Google Workspace administrators can connect to it and enable CSE\nfor their users.\n\nImportant terminology\n---------------------\n\nBelow is a list of common terms used in the Google Workspace Client-side Encryption API:\n\n*Client-side encryption (CSE)*\n: Encryption that's handled in the client's browser before it's stored in\n cloud-based storage. This protects the file from being read by the storage\n provider. [Learn more](https://support.google.com/a/answer/10741897#zippy=%2Chow-is-cse-different-from-end-to-end-ee-encryption)\n\n*Key Access Control List Service (KACLS)*\n: Your external key service that uses this API to control access to encryption\n keys stored in an external system.\n\n*Identity Provider (IdP)*\n: The service that authenticates users before they can encrypt files or access\n encrypted files.\n\n### Encryption \\& decryption\n\n*Data Encryption Key (DEK)*\n: The key used by Google Workspace in the browser client to encrypt the data\n itself.\n\n*Key Encryption Key (KEK)*\n: A key from your service used to encrypt a Data Encryption Key (DEK).\n\n### Access control\n\n*Access Control List (ACL)*\n: A list of users or groups that can open or read a file.\n\n*Authentication JSON Web Token (JWT)*\n: Bearer token ([JWT: RFC 7516](https://tools.ietf.org/html/rfc7516))\n issued by the identity partner (IdP) to attest a user's identity.\n\n*Authorization JSON Web Token (JWT)*\n: Bearer token ([JWT: RFC 7516](https://tools.ietf.org/html/rfc7516))\n issued by Google to verify that the caller is authorized to encrypt or decrypt a resource.\n\n*JSON Web Key Set (JWKS)*\n: A read-only endpoint URL that points to a list of public keys used to verify\n JSON Web Tokens (JWT).\n\n*Perimeter*\n: Additional checks performed on the authentication and authorization tokens\n within the KACLS for access control.\n\nClient-side encryption process\n------------------------------\n\nAfter an administrator enables CSE for their organization, users for whom CSE is\nenabled can choose to create encrypted documents using the Google Workspace\ncollaborative content creation tools, like Docs and Sheets, or encrypt files\nthey upload to Google Drive, such as PDFs.\n\nAfter the user encrypts a document or file:\n\n1. Google Workspace generates a DEK in the client browser to encrypt the\n content.\n\n2. Google Workspace sends the DEK and authentication tokens to your third-party\n KACLS for encryption, using a URL you provide to the\n Google Workspace organization's administrator.\n\n3. Your KACLS uses this API to encrypt the DEK, then sends the obfuscated,\n encrypted DEK back to Google Workspace.\n\n4. Google Workspace stores the obfuscated, encrypted data in the cloud.\n Only users with access to your KACLS are able to access the data.\n\nFor more details, see [Encrypt and decrypt files](/workspace/cse/guides/encrypt-and-decrypt-data).\n\nNext steps\n----------\n\n- Learn how to [configure your service](/workspace/cse/guides/configure-service).\n- Learn how to [encrypt \\& decrypt data](/workspace/cse/guides/encrypt-and-decrypt-data)."]]