เมธอด: wrapprivatekey
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
แพ็กเกจคีย์ส่วนตัวของผู้ใช้ การดำเนินการนี้เป็นการดำเนินการที่มีสิทธิ์ และผู้ดูแลระบบบริการรายการควบคุมการเข้าถึงคีย์ (KACLS) ที่มีสิทธิ์เท่านั้นที่จะดำเนินการได้
คุณใช้ API นี้หรือไม่ก็ได้ ทั้ง Google และไคลเอ็นต์ Gmail ไม่ได้เรียกใช้ API นี้ ข้อกำหนดที่ระบุไว้เป็นเพียงคำแนะนำ ไม่ใช่ข้อกำหนด
คำขอ HTTP
POST https://KACLS_URL/wrapprivatekey
แทนที่ KACLS_URL
ด้วย URL ของบริการรายการควบคุมการเข้าถึงคีย์ (KACLS)
พารามิเตอร์เส้นทาง
ไม่มี
เนื้อหาของคำขอ
เนื้อความของคำขอมีข้อมูลซึ่งมีโครงสร้างดังต่อไปนี้
การแสดง JSON |
{
"authentication": string,
"perimeter_id": string,
"private_key": string
}
|
ช่อง |
authentication |
string
JWT ที่ออกโดยผู้ให้บริการข้อมูลประจำตัว (IdP) ซึ่งระบุตัวตนของผู้ใช้ ดูโทเค็นการตรวจสอบสิทธิ์
|
perimeter_id |
string (UTF-8)
รหัสของขอบเขตที่จะเข้ารหัสด้วยคีย์
|
private_key |
string
DEK ที่เข้ารหัส Base64 ขนาดสูงสุด: 128 ไบต์
|
เนื้อหาการตอบกลับ
หากดำเนินการสำเร็จ วิธีการนี้จะแสดงคีย์ส่วนตัวที่รวมไว้
หากการดำเนินการไม่สำเร็จ ระบบจะแสดงการตอบกลับข้อผิดพลาดที่มีโครงสร้าง
การแสดง JSON |
{
"wrapped_private_key": string
}
|
ช่อง |
wrapped_private_key |
string
คีย์ส่วนตัวที่รวมไว้ซึ่งเข้ารหัส Base64 ขนาดสูงสุด: 8 KB
|
ตัวอย่าง
ตัวอย่างนี้แสดงคำขอและการตอบกลับตัวอย่างสำหรับwrapprivatekey
วิธีนี้
ส่งคำขอ
POST https://mykacls.example.org/v1/wrapprivatekey
{
"private_key": "-----BEGIN RSA PRIVATE KEY-----\\nMIIJ......\\n-----END RSA PRIVATE KEY-----",
"perimeter_id": ""
}
การตอบกลับ
{
"wrapped_private_key": "LpyCSy5ddy82PIp/87JKaMF4Jmt1KdrbfT1iqpB7uhVd3OwZiu+oq8kxIzB7Lr0iX4aOcxM6HiUyMrGP2PG8x0HkpykbUKQxBVcfm6SLdsqigT9ho5RYw20M6ZXNWVRetFSleKex4SRilTRny38e2ju/lUy0KDaCt1hDUT89nLZ1wsO3D1F3xk8J7clXv5fe7GPRd1ojo82Ny0iyVO7y7h1lh2PACHUFXOMzsdURYFCnxhKAsadccCxpCxKh5x8p78PdoenwY1tnT3/X4O/4LAGfT4fo98Frxy/xtI49WDRNZi6fsL6BQT4vS/WFkybBX9tXaenCqlRBDyZSFhatPQ==",
}
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-01 UTC
[null,null,["อัปเดตล่าสุด 2025-08-01 UTC"],[[["\u003cp\u003eWraps a user's private key, a privileged operation only authorized Key Access Control List Service (KACLS) admins can perform.\u003c/p\u003e\n"],["\u003cp\u003eThis API is optional and not used by Google or the Gmail client; the specification is a recommendation.\u003c/p\u003e\n"],["\u003cp\u003eThe API request requires a JSON body containing user authentication, perimeter ID, and the base64-encoded private key.\u003c/p\u003e\n"],["\u003cp\u003eUpon successful execution, the API returns the base64-encoded wrapped private key.\u003c/p\u003e\n"],["\u003cp\u003eIn case of failure, the API returns a structured error reply.\u003c/p\u003e\n"]]],["Authorized Key Access Control List Service (KACLS) admins can use the `wrapprivatekey` API to wrap a user's private key via a POST request. The request requires a JWT (`authentication`), a `perimeter_id`, and a base64-encoded `private_key` (max 128 bytes). Upon success, the API returns a base64-encoded `wrapped_private_key` (max 8 KB). This API is optional, not used by Google or Gmail, and serves as a recommendation.\n"],null,["# Method: wrapprivatekey\n\nWraps a user's private key. This is a privileged operation, and can only be\nperformed by authorized Key Access Control List Service (KACLS) admins.\nThis API is optional. Neither Google nor the Gmail client calls\nthis API. The specification provided is a recommendation, not a requirement.\n\n### HTTP request\n\n`POST https://`\u003cvar translate=\"no\"\u003eKACLS_URL\u003c/var\u003e`/wrapprivatekey`\n\nReplace \u003cvar translate=\"no\"\u003eKACLS_URL\u003c/var\u003e with the Key Access Control List\nService (KACLS) URL.\n\n### Path parameters\n\nNone.\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation ||\n|-------------------------------------------------------------------------------------|---|\n| ``` { \"authentication\": string, \"perimeter_id\": string, \"private_key\": string } ``` |\n\n| Fields ||\n|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `authentication` | `string` A JWT issued by the identity provider (IdP) asserting who the user is. See [authentication tokens](/workspace/cse/reference/authentication-tokens). |\n| `perimeter_id` | `string (UTF-8)` The perimeter ID to encrypt with the key. |\n| `private_key` | `string` The base64-encoded DEK. Max size: 128 bytes. |\n\n### Response body\n\nIf successful, this method returns the wrapped private key.\n\nIf the operation fails, a\n[structured error reply](/workspace/cse/reference/structured-errors)\nis returned.\n\n| JSON representation ||\n|-------------------------------------------|---|\n| ``` { \"wrapped_private_key\": string } ``` |\n\n| Fields ||\n|-----------------------|------------------------------------------------------------------|\n| `wrapped_private_key` | `string` The base64-encoded wrapped private key. Max size: 8 KB. |\n\n### Example\n\nThis example provides a sample request and response for the `wrapprivatekey`\nmethod.\n\n#### Request\n\n POST https://mykacls.example.org/v1/wrapprivatekey\n\n {\n \"private_key\": \"-----BEGIN RSA PRIVATE KEY-----\\\\nMIIJ......\\\\n-----END RSA PRIVATE KEY-----\",\n \"perimeter_id\": \"\"\n }\n\n#### Response\n\n {\n \"wrapped_private_key\": \"LpyCSy5ddy82PIp/87JKaMF4Jmt1KdrbfT1iqpB7uhVd3OwZiu+oq8kxIzB7Lr0iX4aOcxM6HiUyMrGP2PG8x0HkpykbUKQxBVcfm6SLdsqigT9ho5RYw20M6ZXNWVRetFSleKex4SRilTRny38e2ju/lUy0KDaCt1hDUT89nLZ1wsO3D1F3xk8J7clXv5fe7GPRd1ojo82Ny0iyVO7y7h1lh2PACHUFXOMzsdURYFCnxhKAsadccCxpCxKh5x8p78PdoenwY1tnT3/X4O/4LAGfT4fo98Frxy/xtI49WDRNZi6fsL6BQT4vS/WFkybBX9tXaenCqlRBDyZSFhatPQ==\",\n }"]]