Mantieni tutto organizzato con le raccolte Salva e classifica i contenuti in base alle tue preferenze.
Questa guida descrive il funzionamento della crittografia e della decrittografia utilizzando l'API Crittografia lato client di Google Workspace.
Devi inserire nella lista consentita tutti i servizi del provider di identità (IdP) utilizzati dagli utenti che condividono file criptati. Normalmente, puoi trovare i dettagli dell'IdP richiesti nel file .well-known disponibile pubblicamente; in caso contrario, contatta l'amministratore di Google Workspace dell'organizzazione per richiedere i dettagli dell'IdP.
Criptare i dati
Quando un utente Google Workspace richiede di salvare o archiviare dati con crittografia lato client (CSE), Google Workspace invia una richiesta wrap all'URL dell'endpoint del servizio dell'elenco di controllo dell'accesso per le chiavi (KACLS) per la crittografia. Oltre ai controlli di sicurezza facoltativi, come quelli basati sulle rivendicazioni perimetrali e JWT, il tuo KACLS deve eseguire i seguenti passaggi:
Verifica che i token di autorizzazione e autenticazione siano per lo stesso utente eseguendo una corrispondenza senza distinzione tra maiuscole e minuscole per le rivendicazioni email.
Quando il token di autenticazione contiene l'attestazione facoltativa google_email, deve essere confrontata con l'attestazione email nel token di autorizzazione utilizzando un approccio che non fa distinzione tra maiuscole e minuscole. Non utilizzare la rivendicazione dell'email all'interno del token di autenticazione per questo confronto.
Negli scenari in cui il token di autenticazione non include l'attributo google_email facoltativo, l'attributo email all'interno del token di autenticazione deve essere confrontato con l'attributo email nel token di autorizzazione, utilizzando un metodo che non fa distinzione tra maiuscole e minuscole.
Negli scenari in cui Google rilascia un token di autorizzazione per un'email non associata a un Account Google, deve essere presente l'attestazione email_type. Questo costituisce una parte fondamentale della funzionalità Accesso ospite, fornendo informazioni preziose per consentire agli elenchi di controllo dell'accesso per le chiavi di applicare misure di sicurezza aggiuntive agli utenti esterni.
Di seguito sono riportati alcuni esempi di come un KACLS può utilizzare queste informazioni:
Per imporre requisiti di logging aggiuntivi.
Per limitare l'emittente del token di autenticazione a un IdP ospite dedicato.
Per richiedere rivendicazioni aggiuntive sul token di autenticazione.
Se un cliente non ha configurato l'accesso ospite, tutte le richieste in cui email_type è impostato su google-visitor o customer-idp possono essere rifiutate. Le richieste con un email_type di google o con un email_type non impostato devono continuare a essere accettate.
Quando il token di autenticazione contiene l'attestazione facoltativa delegated_to, deve contenere anche l'attestazione resource_name e queste due attestazioni devono essere confrontate con le attestazioni delegated_to e resource_name nel token di autorizzazione. Le rivendicazioni delegated_to devono essere confrontate utilizzando un approccio senza distinzione tra maiuscole e minuscole e il resource_name nei token deve corrispondere al resource_name dell'operazione.
Verifica che la rivendicazione role nel token di autorizzazione sia writer o upgrader.
Verifica che l'attestazione kacls_url nel token di autorizzazione corrisponda all'URL KACLS attuale. Questo controllo consente di rilevare potenziali server man-in-the-middle configurati da insider o amministratori di dominio malintenzionati.
Esegui un controllo del perimetro utilizzando sia le rivendicazioni di autenticazione che di autorizzazione.
Cripta le seguenti parti utilizzando un algoritmo di crittografia autenticata:
Chiave di crittografia dei dati (DEK)
I valori resource_name e perimeter_id del token di autorizzazione
Eventuali dati sensibili aggiuntivi
Registra l'operazione, inclusi l'utente che l'ha avviata, il resource_name e il motivo indicato nella richiesta.
Restituisce un oggetto binario opaco da archiviare da Google Workspace insieme all'oggetto criptato e inviato così com'è in qualsiasi operazione di scarto della chiave successiva. In alternativa, fornisci una risposta di errore strutturata.
L'oggetto binario deve contenere l'unica copia della DEK criptata, in cui possono essere memorizzati dati specifici dell'implementazione.
Decriptare i dati
Quando un utente Google Workspace richiede di aprire dati criptati lato client (CSE), Google Workspace invia una richiesta unwrap all'URL dell'endpoint KACLS per la decriptazione. Oltre ai controlli di sicurezza facoltativi, come i controlli perimetrali e basati sulle rivendicazioni JWT, il tuo KACLS deve eseguire i seguenti passaggi:
Verifica che i token di autorizzazione e autenticazione siano per lo stesso utente eseguendo una corrispondenza senza distinzione tra maiuscole e minuscole per le rivendicazioni email.
Quando il token di autenticazione contiene l'attestazione facoltativa google_email, deve essere confrontata con l'attestazione email nel token di autorizzazione utilizzando un approccio che non fa distinzione tra maiuscole e minuscole. Non utilizzare la rivendicazione dell'email all'interno del token di autenticazione per questo confronto.
Negli scenari in cui il token di autenticazione non include l'attributo google_email facoltativo, l'attributo email all'interno del token di autenticazione deve essere confrontato con l'attributo email nel token di autorizzazione, utilizzando un metodo che non fa distinzione tra maiuscole e minuscole.
Negli scenari in cui Google rilascia un token di autorizzazione per un'email non associata a un Account Google, deve essere presente l'attestazione email_type. Questo costituisce una parte fondamentale della funzionalità Accesso ospite, fornendo informazioni preziose per consentire agli elenchi di controllo dell'accesso per le chiavi di applicare misure di sicurezza aggiuntive agli utenti esterni.
Di seguito sono riportati alcuni esempi di come un KACLS può utilizzare queste informazioni:
Per imporre requisiti di logging aggiuntivi.
Per limitare l'emittente del token di autenticazione a un IdP ospite dedicato.
Per richiedere rivendicazioni aggiuntive sul token di autenticazione.
Se un cliente non ha configurato l'accesso ospite, tutte le richieste in cui email_type è impostato su google-visitor o customer-idp possono essere rifiutate. Le richieste con un email_type di google o con un email_type non impostato devono continuare a essere accettate.
Quando il token di autenticazione contiene l'attestazione facoltativa delegated_to, deve contenere anche l'attestazione resource_name e queste due attestazioni devono essere confrontate con le attestazioni delegated_to e resource_name nel token di autorizzazione. Le rivendicazioni delegated_to devono essere confrontate utilizzando un approccio senza distinzione tra maiuscole e minuscole e il resource_name nei token deve corrispondere al resource_name dell'operazione.
Verifica che la rivendicazione role nel token di autorizzazione sia reader o writer.
Verifica che l'attestazione kacls_url nel token di autorizzazione corrisponda all'URL KACLS attuale. Ciò consente di rilevare potenziali server man-in-the-middle configurati da utenti malintenzionati o amministratori di dominio non autorizzati.
Decrittografa le seguenti parti utilizzando un algoritmo di crittografia autenticata:
Chiave di crittografia dei dati (DEK)
I valori resource_name e perimeter_id del token di autorizzazione
Eventuali dati sensibili aggiuntivi
Verifica che il resource_name nel token di autorizzazione e nel blob decriptato corrispondano.
Esegui un controllo del perimetro utilizzando sia le rivendicazioni di autenticazione che quelle di autorizzazione.
Registra l'operazione, inclusi l'utente che l'ha avviata, il resource_name e il motivo indicato nella richiesta.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-08-04 UTC."],[[["\u003cp\u003eThis guide outlines the process of encrypting and decrypting data using the Google Workspace Client-side Encryption API, leveraging a Key Access and Control List Service (KACLS).\u003c/p\u003e\n"],["\u003cp\u003eDuring encryption, the KACLS validates the user, encrypts the data encryption key (DEK) and other sensitive data, logs the operation, and returns an opaque binary object containing the encrypted DEK to Google Workspace for storage.\u003c/p\u003e\n"],["\u003cp\u003eFor decryption, the KACLS validates the user, decrypts the DEK and associated data, verifies the resource name, performs a perimeter check, logs the operation, and returns the unwrapped DEK to Google Workspace.\u003c/p\u003e\n"],["\u003cp\u003eBefore sharing encrypted files, ensure to allowlist any Identity Provider (IdP) services used by the intended recipients, which typically involves obtaining IdP details from their publicly available .well-known file or contacting their Google Workspace administrator.\u003c/p\u003e\n"]]],["When users encrypt data, the KACLS must validate user authentication and authorization tokens, ensuring matching email claims and specific role and URL claims. It encrypts the Data Encryption Key (DEK), `resource_name`, `perimeter_id`, and other sensitive data, logs the operation, and returns an encrypted object. For decryption, the process mirrors encryption, validating tokens, decrypting the data, verifying `resource_name`, performing perimeter checks, logging, and returning the DEK. Guest access requires extra checks. Identity provider services must be allowlisted.\n"],null,["# Encrypt & decrypt data\n\nThis guide describes how encryption and decryption works using the Google Workspace Client-side Encryption API.\n\nYou must allowlist any Identity Provider (IdP) services used by users\nsharing encrypted files. You can usually find the required IdP details in their\npublicly-available .well-known file; otherwise, contact the organization's\nGoogle Workspace administrator for their IdP details.\n\nEncrypt data\n------------\n\nWhen a Google Workspace user requests to save or store client-side encrypted\n(CSE) data, Google Workspace sends a [`wrap`](/workspace/cse/reference/wrap)\nrequest to your Key Access Control List Service (KACLS) endpoint URL for encryption.\nIn addition to optional security checks, such as perimeter and JWT claim-based checks,\nyour KACLS must perform the following steps:\n\n1. Validate the requesting user.\n\n - Validate both the [authentication token](/workspace/cse/reference/authentication-tokens) and [authorization token](/workspace/cse/reference/authorization-tokens).\n - Check that authorization and authentication tokens are for the same user by doing a case-insensitive match on the email claims.\n - When the authentication token contains the optional `google_email` claim, it must be compared against the email claim in the authorization token using a case-insensitive approach. Don't use the email claim within the authentication token for this comparison.\n - In scenarios where the authentication token lacks the optional `google_email` claim, the email claim within the authentication token should be compared with the email claim in the authorization token, using a case-insensitive method.\n - In scenarios where Google issues an authorization token for an email not associated with a Google Account, the `email_type` claim must be present. This forms a crucial part of the Guest Access feature, providing valuable information for KACLS to enforce additional security measures on external users.\n - Some examples of how a KACLS can use this information include:\n - To impose additional logging requirements.\n - To restrict the authentication token issuer to a dedicated Guest IdP.\n - To require additional claims on the authentication token.\n - If a customer has not configured Guest Access, then all requests where `email_type` is set to `google-visitor` or `customer-idp` can be rejected. Requests with an `email_type` of `google` or with an unset `email_type` should continue to be accepted.\n - When the authentication token contains the optional `delegated_to` claim, it must also contain the `resource_name` claim, and these two claims must be compared against the `delegated_to` and `resource_name` claims in the authorization token. The `delegated_to` claims should be compared using a case-insensitive approach, and the `resource_name` in the tokens should match the `resource_name` of the operation.\n - Check that the `role` claim in the authorization token is `writer` or `upgrader`.\n - Check that the `kacls_url` claim in the authorization token matches the current KACLS URL. This check allows detection of potential man-in-the-middle servers configured by insiders or rogue domain administrators.\n - Perform a perimeter check using both authentication and authorization claims.\n2. Encrypt the following parts using an authenticated encryption algorithm:\n\n - Data Encryption Key (DEK)\n - The `resource_name` and `perimeter_id` values from the authorization token\n - Any additional sensitive data\n3. Log the operation, including the user originating it, the `resource_name` and\n the reason passed in the request.\n\n4. Return an opaque binary object to be stored by Google Workspace alongside\n the encrypted object and sent as-is in any subsequent key unwrapping\n operation. Or, serve a [structured error reply](/workspace/cse/reference/structured-errors).\n\n - The binary object should contain the only copy of the encrypted DEK, implementation specific data can be stored in it.\n\n| **Note:** Do not store the DEK in your KACLS system. Instead, encrypt it and return it in the `wrapped_key` object to prevent discrepancies for the lifetime of the file. Google doesn't send deletion requests to the KACLS when objects are deleted.\n\nDecrypt data\n------------\n\nWhen a Google Workspace user requests to open client-side encrypted (CSE) data,\nGoogle Workspace sends an [`unwrap`](/workspace/cse/reference/unwrap) request\nto your KACLS endpoint URL for decryption. In addition to optional security\nchecks, such as perimeter and JWT claim-based checks, your KACLS must perform\nthe following steps:\n\n1. Validate the requesting user.\n\n - Validate both the [authentication token](/workspace/cse/reference/authentication-tokens) and [authorization token](/workspace/cse/reference/authorization-tokens).\n - Check that authorization and authentication tokens are for the same user by doing a case-insensitive match on the email claims.\n - When the authentication token contains the optional `google_email` claim, it must be compared against the email claim in the authorization token using a case-insensitive approach. Don't use the email claim within the authentication token for this comparison.\n - In scenarios where the authentication token lacks the optional `google_email` claim, the email claim within the authentication token should be compared with the email claim in the authorization token, using a case-insensitive method.\n - In scenarios where Google issues an authorization token for an email not associated with a Google Account, the `email_type` claim must be present. This forms a crucial part of the Guest Access feature, providing valuable information for KACLS to enforce additional security measures on external users.\n - Some examples of how a KACLS can use this information include:\n - To impose additional logging requirements.\n - To restrict the authentication token issuer to a dedicated Guest IdP.\n - To require additional claims on the authentication token.\n - If a customer has not configured Guest Access, then all requests where `email_type` is set to `google-visitor` or `customer-idp` can be rejected. Requests with an `email_type` of `google` or with an unset `email_type` should continue to be accepted.\n - When the authentication token contains the optional `delegated_to` claim, it must also contain the `resource_name` claim, and these two claims must be compared against the `delegated_to` and `resource_name` claims in the authorization token. The `delegated_to` claims should be compared using a case-insensitive approach, and the `resource_name` in the tokens should match the `resource_name` of the operation.\n - Check that the `role` claim in the authorization token is `reader` or `writer`.\n - Check that the `kacls_url` claim in the authorization token matches the current KACLS URL. This allows detection of potential man-in-the-middle servers configured by insiders or rogue domain administrators.\n2. Decrypt the following parts using an authenticated encryption algorithm:\n\n - Data Encryption Key (DEK)\n - The `resource_name` and `perimeter_id` values from the authorization token\n - Any additional sensitive data\n3. Check that the `resource_name` in the authorization token and decrypted blob\n match.\n\n4. Perform a perimeter check using both authentication and authorization claims.\n\n5. Log the operation, including the user originating it, the `resource_name` and\n the reason passed in the request.\n\n6. Return the unwrapped DEK or a [structured error reply](/workspace/cse/reference/structured-errors).\n\n| **Note:** To decrypt [Google Takeout](https://support.google.com/a/answer/100458) requests, see [`takeout_unwrap`](/workspace/cse/reference/takeout_unwrap)."]]