Methode: Unwrap
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Gibt einen entschlüsselten Datenverschlüsselungsschlüssel (Decrypt Data Encryption Key, DEK) zurück.
Weitere Informationen finden Sie unter Verschlüsseln und Daten entschlüsseln.
HTTP-Anfrage
POST https://KACLS_URL/unwrap
Ersetzen Sie KACLS_URL
durch den Key Access Control List Service (KACLS)
URL
Pfadparameter
Keine.
Anfragetext
Der Anfragetext enthält Daten mit folgender Struktur:
JSON-Darstellung |
{
"authentication": string,
"authorization": string,
"reason": string,
"wrapped_key": string
}
|
Felder |
authentication |
string
Ein vom IdP ausgestelltes JWT, das den Nutzer bestätigt. Siehe Authentifizierungstokens
|
authorization |
string
Ein JWT, das bestätigt, dass der Nutzer einen Schlüssel für resource_name entpacken darf. Siehe Autorisierungstoken.
|
reason |
string (UTF-8)
Ein Passthrough-JSON-String, der zusätzlichen Kontext zum Vorgang liefert. Die bereitgestellte JSON-Datei muss vor der Anzeige bereinigt werden. Maximale Größe: 1 KB.
|
wrapped_key |
string
Das von wrap zurückgegebene binäre base64-Objekt.
|
Antworttext
Wenn der Vorgang erfolgreich ist, gibt diese Methode den Verschlüsselungsschlüssel des Dokuments zurück.
Wenn der Vorgang fehlschlägt,
strukturierte Fehlerantwort
zurückgegeben werden soll.
JSON-Darstellung |
{
"key": string
}
|
Felder |
key |
string
Der base64-codierte DEK.
|
Beispiel
Dieses Beispiel bietet eine Beispielanfrage und -antwort für die Methode unwrap
.
Anfrage
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'}"
}
Antwort
{
"key": "0saNxttLMQULfXuTbRFJzi/QJokN1jW16u0yaNvvLdQ="
}
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-07-25 (UTC).
[null,null,["Zuletzt aktualisiert: 2025-07-25 (UTC)."],[[["\u003cp\u003eReturns the decrypted Data Encryption Key (DEK) when provided with a wrapped key, authentication, authorization, and reason.\u003c/p\u003e\n"],["\u003cp\u003eRequires a wrapped key generated by the \u003ccode\u003ewrap\u003c/code\u003e method, alongside authentication and authorization tokens for security and access control.\u003c/p\u003e\n"],["\u003cp\u003eAccepts an optional reason parameter for providing context about the operation, which should be sanitized before display.\u003c/p\u003e\n"],["\u003cp\u003eReturns the base64-encoded DEK on successful execution, or a structured error reply if the operation fails.\u003c/p\u003e\n"],["\u003cp\u003eUtilizes the KACLS URL for making the POST request and requires specifying the version in the URL path (e.g., /v1/unwrap).\u003c/p\u003e\n"]]],["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"],null,["# Method: unwrap\n\nReturns decrypted Data Encryption Key (DEK).\n\nFor more details, see [Encrypt \\& decrypt data](/workspace/cse/guides/encrypt-and-decrypt-data).\n\n### HTTP request\n\n`POST https://`\u003cvar translate=\"no\"\u003eKACLS_URL\u003c/var\u003e`/unwrap`\n\nReplace \u003cvar translate=\"no\"\u003eKACLS_URL\u003c/var\u003e with the Key Access Control List Service (KACLS)\nURL.\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, \"reason\": string, \"wrapped_key\": string } ``` |\n\n| Fields ||\n|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `authentication` | `string` A JWT issued by the 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| `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_key` | `string` The base64 binary object returned by [`wrap`](/workspace/cse/reference/wrap). |\n\n### Response body\n\nIf successful, this method returns the document encryption key.\n\nIf the operation fails, a\n[structured error reply](/workspace/cse/reference/structured-errors)\nshould be returned.\n\n| JSON representation ||\n|---------------------------|---|\n| ``` { \"key\": string } ``` |\n\n| Fields ||\n|-------|----------------------------------|\n| `key` | `string` The base64-encoded DEK. |\n\n### Example\n\nThis example provides a sample request and response for the `unwrap` method.\n\n#### Request\n\n POST https://mykacls.example.com/v1/unwrap\n\n {\n \"wrapped_key\": \"7qTh6Mp+svVwYPlnZMyuj8WHTrM59wl/UI50jo61Qt/QubZ9tfsUc1sD62xdg3zgxC9quV4r+y7AkbfIDhbmxGqP64pWbZgFzOkP0JcSn+1xm/CB2E5IknKsAbwbYREGpiHM3nzZu+eLnvlfbzvTnJuJwBpLoPYQcnPvcgm+5gU1j1BjUaNKS/uDn7VbVm7hjbKA3wkniORC2TU2MiHElutnfrEVZ8wQfrCEpuWkOXs98H8QxUK4pBM2ea1xxGj7vREAZZg1x/Ci/E77gHxymnZ/ekhUIih6Pwu75jf+dvKcMnpmdLpwAVlE1G4dNginhFVyV/199llf9jmHasQQuaMFzQ9UMWGjA1Hg2KsaD9e3EL74A5fLkKc2EEmBD5v/aP+1RRZ3ISbTOXvxqYIFCdSFSCfPbUhkc9I2nHS0obEH7Q7KiuagoDqV0cTNXWfCGJ1DtIlGQ9IA6mPDAjX8Lg==\",\n \"authorization\": \"eyJhbGciOi...\"\n \"authentication\": \"eyJhbGciOi...\"\n \"reason\": \"{client:'drive' op:'read'}\"\n }\n\n#### Response\n\n {\n \"key\": \"0saNxttLMQULfXuTbRFJzi/QJokN1jW16u0yaNvvLdQ=\"\n }"]]