เมธอด: Privatekeydecrypt
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
แกะคีย์ส่วนตัวที่รวม แล้วถอดรหัสคีย์การเข้ารหัสเนื้อหา
ที่เข้ารหัสด้วยคีย์สาธารณะ
คำขอ HTTP
POST https://KACLS_URL/privatekeydecrypt
แทนที่ KACLS_URL
ด้วย URL ของบริการรายการควบคุมการเข้าถึงคีย์ (KACL)
พารามิเตอร์เส้นทาง
ไม่มี
เนื้อความของคำขอ
เนื้อหาของคำขอมีข้อมูลซึ่งมีโครงสร้างดังต่อไปนี้
การแสดง JSON |
{
"authentication": string,
"authorization": string,
"algorithm": string,
"encrypted_data_encryption_key": string,
"rsa_oaep_label": string,
"reason": string,
"wrapped_private_key": string
}
|
ช่อง |
authentication |
string
JWT ที่ออกโดยผู้ให้บริการข้อมูลประจำตัว (IdP) ซึ่งยืนยันตัวตนของผู้ใช้ ดูโทเค็นการตรวจสอบสิทธิ์
|
authorization |
string
JWT ที่ยืนยันว่าผู้ใช้ได้รับอนุญาตให้แกะคีย์สำหรับ resource_name ดูโทเค็นการให้สิทธิ์
|
algorithm |
string
อัลกอริทึมที่ใช้เพื่อเข้ารหัสคีย์การเข้ารหัสข้อมูล (DEK) ในการเข้ารหัสแบบซองจดหมาย
|
encrypted_data_encryption_key |
string (UTF-8)
คีย์การเข้ารหัสเนื้อหาที่เข้ารหัส Base64 ซึ่งเข้ารหัสด้วยคีย์สาธารณะที่เชื่อมโยงกับคีย์ส่วนตัว ขนาดสูงสุด: 1 KB
|
rsa_oaep_label |
string
ป้ายกำกับ L ที่เข้ารหัส Base64 หากอัลกอริทึมคือ RSAES-OAEP หากอัลกอริทึมไม่ใช่ RSAES-OAEP ระบบจะไม่สนใจฟิลด์นี้
|
reason |
string (UTF-8)
สตริง JSON แบบส่งผ่านที่ให้บริบทเพิ่มเติมเกี่ยวกับการดำเนินการ ควรล้างข้อมูล JSON ที่ระบุก่อนแสดง ขนาดสูงสุด: 1 KB
|
wrapped_private_key |
string
คีย์ส่วนตัวที่รวมไว้ซึ่งเข้ารหัส Base64 ขนาดสูงสุด: 8 KB
รูปแบบของคีย์ส่วนตัวหรือคีย์ส่วนตัวที่ห่อหุ้มขึ้นอยู่กับการติดตั้งใช้งานบริการรายการควบคุมการเข้าถึงคีย์ (KACLS) ทั้งในฝั่งไคลเอ็นต์และฝั่ง Gmail ระบบจะถือว่านี่เป็น Blob ที่ทึบแสง
|
เนื้อหาการตอบกลับ
หากสำเร็จ วิธีนี้จะแสดงคีย์การเข้ารหัสข้อมูล base64
หากการดำเนินการล้มเหลว ระบบจะแสดงผลการตอบกลับข้อผิดพลาดที่มีโครงสร้าง
การแสดง JSON |
{
"data_encryption_key": string
}
|
ช่อง |
data_encryption_key |
string
คีย์การเข้ารหัสข้อมูลที่เข้ารหัส Base64
|
ตัวอย่าง
ตัวอย่างนี้แสดงคำขอและการตอบกลับตัวอย่างสำหรับเมธอด privatekeydecrypt
ส่งคำขอ
POST https://mykacls.example.org/v1/privatekeydecrypt
{
"wrapped_private_key": "wHrlNOTI9mU6PBdqiq7EQA...",
"encrypted_data_encryption_key": "dGVzdCB3cmFwcGVkIGRlaw...",
"authorization": "eyJhbGciOi...",
"authentication": "eyJhbGciOi...",
"algorithm": "RSA/ECB/PKCS1Padding",
"reason": "decrypt"
}
การตอบกลับ
{
"data_encryption_key": "akRQtv3nr+jUhcFL6JmKzB+WzUxbkkMyW5kQsqGUAFc="
}
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-04 UTC
[null,null,["อัปเดตล่าสุด 2025-08-04 UTC"],[[["\u003cp\u003eThis endpoint (\u003ccode\u003eprivatekeydecrypt\u003c/code\u003e) unwraps a wrapped private key and decrypts the data encryption key.\u003c/p\u003e\n"],["\u003cp\u003eThe request body requires authentication, authorization, algorithm, encrypted data encryption key, wrapped private key, and optionally, RSA OAEP label and reason.\u003c/p\u003e\n"],["\u003cp\u003eUpon successful execution, the endpoint returns the base64-encoded data encryption key.\u003c/p\u003e\n"],["\u003cp\u003eIf the operation fails, a structured error response will be returned.\u003c/p\u003e\n"],["\u003cp\u003eAn example request and response are provided for illustration.\u003c/p\u003e\n"]]],["The `privatekeydecrypt` method unwraps a provided private key and decrypts an encrypted data encryption key (DEK). A POST request is sent to the `BASE_URL/privatekeydecrypt` endpoint. The request body requires `authentication`, `authorization`, `algorithm`, `encrypted_data_encryption_key`, `rsa_oaep_label`(optional), `reason`, and `wrapped_private_key`. Upon success, the response body returns the decrypted base64-encoded `data_encryption_key`; otherwise, a structured error is returned.\n"],null,["# Method: privatekeydecrypt\n\nUnwraps a wrapped private key and then decrypts the content encryption key\nthat is encrypted to the public key.\n\n### HTTP request\n\n`POST https://`\u003cvar translate=\"no\"\u003eKACLS_URL\u003c/var\u003e`/privatekeydecrypt`\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, \"authorization\": string, \"algorithm\": string, \"encrypted_data_encryption_key\": string, \"rsa_oaep_label\": string, \"reason\": string, \"wrapped_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| `authorization` | `string` A JWT asserting that the user is allowed to unwrap a key for `resource_name`. See [authorization tokens](/workspace/cse/reference/authorization-tokens). |\n| `algorithm` | `string` The algorithm that was used to encrypt the Data Encryption Key (DEK) in envelope encryption. |\n| `encrypted_data_encryption_key` | `string (UTF-8)` Base64-encoded encrypted content encryption key, which is encrypted with the public key associated with the private key. Max size: 1 KB. |\n| `rsa_oaep_label` | `string` Base64-encoded label L, if the algorithm is RSAES-OAEP. If the algorithm is not RSAES-OAEP, this field is ignored. |\n| `reason` | `string (UTF-8)` A passthrough JSON string providing additional context about the operation. The JSON provided should be sanitized before being displayed. Max size: 1 KB. |\n| `wrapped_private_key` | `string` The base64-encoded wrapped private key. Max size: 8 KB. The format of the private key or the wrapped private key is up to the Key Access Control List Service (KACLS) implementation. On the client and on the Gmail side, this is treated as an opaque blob. |\n\n### Response body\n\nIf successful, this method returns a base64 data encryption key.\n\nIf the operation fails, a\n[structured error reply](/workspace/cse/reference/structured-errors)\nis returned.\n\n| JSON representation ||\n|-------------------------------------------|---|\n| ``` { \"data_encryption_key\": string } ``` |\n\n| Fields ||\n|-----------------------|------------------------------------------------|\n| `data_encryption_key` | `string` A base64-encoded data encryption key. |\n\n### Example\n\nThis example provides a sample request and response for the `privatekeydecrypt`\nmethod.\n\n#### Request\n\n POST https://mykacls.example.org/v1/privatekeydecrypt\n\n {\n \"wrapped_private_key\": \"wHrlNOTI9mU6PBdqiq7EQA...\",\n \"encrypted_data_encryption_key\": \"dGVzdCB3cmFwcGVkIGRlaw...\",\n \"authorization\": \"eyJhbGciOi...\",\n \"authentication\": \"eyJhbGciOi...\",\n \"algorithm\": \"RSA/ECB/PKCS1Padding\",\n \"reason\": \"decrypt\"\n }\n\n#### Response\n\n {\n \"data_encryption_key\": \"akRQtv3nr+jUhcFL6JmKzB+WzUxbkkMyW5kQsqGUAFc=\"\n }"]]