An optional parameter to set the Customer-Supplied Encryption key for rewrite source object.
Application developers can generate their own encryption keys to protect the data in GCS. This is known as a Customer-Supplied Encryption key (CSEK). If the application provides a CSEK, GCS does not retain the key. The object data, the object CRC32 checksum, and its MD5 hash (if applicable) are all encrypted with this key, and the key is required to read any of these elements back.
Care must be taken to save and protect these keys, if lost, the data is not recoverable. Also, applications should avoid generating predictable keys, as this weakens the encryption.
This option is used only in rewrite operations and it defines the key used for the source object.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-14 UTC."],[[["\u003cp\u003eThis document outlines the \u003ccode\u003eSourceEncryptionKey\u003c/code\u003e structure for Google Cloud Storage (GCS), which is used for managing Customer-Supplied Encryption Keys (CSEK) during object rewrite operations.\u003c/p\u003e\n"],["\u003cp\u003eThe provided versions list shows the availability of this feature across different versions, starting from 2.11.0 up to the latest release candidate 2.37.0-rc.\u003c/p\u003e\n"],["\u003cp\u003eCSEK allows users to encrypt data in GCS using their own encryption keys, offering enhanced security where GCS does not retain the keys, meaning that it will be required to access the data.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eSourceEncryptionKey\u003c/code\u003e can be created from either a binary key or a base64-encoded key, with both methods requiring a 32-byte key.\u003c/p\u003e\n"],["\u003cp\u003eThis document also includes a link to the official Google Cloud documentation for more in-depth information about CSEK.\u003c/p\u003e\n"]]],[],null,[]]