方法:解除包裝
傳回已解密的資料加密金鑰 (DEK)。
詳情請參閱加密與解密資料。
HTTP 要求
POST https://KACLS_URL/unwrap
將 KACLS_URL
替換為金鑰存取控制清單服務 (KACLS)
網址。
路徑參數
無。
要求主體
要求主體的資料會採用以下結構:
JSON 表示法 |
{
"authentication": string,
"authorization": string,
"reason": string,
"wrapped_key": string
}
|
欄位 |
authentication |
string
由 IdP 核發的使用者核發的 JWT。請參閱驗證權杖。
|
authorization |
string
JWT 宣告是否允許使用者為 resource_name 解除包裝金鑰。查看授權權杖。
|
reason |
string (UTF-8)
直通式 JSON 字串,提供作業的其他背景資訊。提供的 JSON 必須先經過處理,才會顯示。大小上限:1 KB。
|
wrapped_key |
string
wrap 傳回的 Base64 二進位物件。
|
回應主體
如果成功,這個方法會傳回文件加密金鑰。
如果作業失敗,
結構化錯誤回覆
。
JSON 表示法 |
{
"key": string
}
|
欄位 |
key |
string
Base64 編碼的 DEK。
|
範例
這個範例提供了 unwrap
方法的要求和回應範例。
要求
POST https://mykacls.example.com/v1/unwrap
{
"wrapped_key": "7qTh6Mp+svVwYPlnZMyuj8WHTrM59wl/UI50jo61Qt/QubZ9tfsUc1sD62xdg3zgxC9quV4r+y7AkbfIDhbmxGqP64pWbZgFzOkP0JcSn+1xm/CB2E5IknKsAbwbYREGpiHM3nzZu+eLnvlfbzvTnJuJwBpLoPYQcnPvcgm+5gU1j1BjUaNKS/uDn7VbVm7hjbKA3wkniORC2TU2MiHElutnfrEVZ8wQfrCEpuWkOXs98H8QxUK4pBM2ea1xxGj7vREAZZg1x/Ci/E77gHxymnZ/ekhUIih6Pwu75jf+dvKcMnpmdLpwAVlE1G4dNginhFVyV/199llf9jmHasQQuaMFzQ9UMWGjA1Hg2KsaD9e3EL74A5fLkKc2EEmBD5v/aP+1RRZ3ISbTOXvxqYIFCdSFSCfPbUhkc9I2nHS0obEH7Q7KiuagoDqV0cTNXWfCGJ1DtIlGQ9IA6mPDAjX8Lg==",
"authorization": "eyJhbGciOi…"
"authentication": "eyJhbGciOi…"
"reason": "{client:'drive' op:'read'}"
}
回應
{
"key": "0saNxttLMQULfXuTbRFJzi/QJokN1jW16u0yaNvvLdQ="
}
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-08-22 (世界標準時間)。
[null,null,["上次更新時間:2024-08-22 (世界標準時間)。"],[[["Returns the decrypted Data Encryption Key (DEK) when provided with a wrapped key, authentication, authorization, and reason."],["Requires a wrapped key generated by the `wrap` method, alongside authentication and authorization tokens for security and access control."],["Accepts an optional reason parameter for providing context about the operation, which should be sanitized before display."],["Returns the base64-encoded DEK on successful execution, or a structured error reply if the operation fails."],["Utilizes the KACLS URL for making the POST request and requires specifying the version in the URL path (e.g., /v1/unwrap)."]]],["The `unwrap` method decrypts a Data Encryption Key (DEK). It requires a `POST` request to the KACLS URL with a JSON body containing: `authentication` (user ID JWT), `authorization` (key unwrapping permission JWT), `reason` (operation context), and `wrapped_key` (base64 encrypted key). A successful response returns a JSON body with the decrypted `key` (base64-encoded DEK). Failure returns a structured error.\n"]]