Google Cloud Storage C++ Client  1.42.0
A C++ Client Library for Google Cloud Storage
Static Public Member Functions | List of all members
google::cloud::storage::SourceEncryptionKey Struct Reference

An optional parameter to set the Customer-Supplied Encryption key for rewrite source object. More...

#include <google/cloud/storage/well_known_headers.h>

Static Public Member Functions

static SourceEncryptionKey FromBinaryKey (std::string const &key)
 Creates a source encryption key parameter from a binary key. More...
 
static SourceEncryptionKey FromBase64Key (std::string const &key)
 Creates an encryption key parameter from a key in base64 format. More...
 
static char const * prefix ()
 

Detailed Description

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.

See also
https://cloud.google.com/storage/docs/encryption/customer-supplied-keys for a detailed description of how Customer Supplied Encryption keys are used in GCS.

Definition at line 227 of file well_known_headers.h.

Member Function Documentation

◆ FromBase64Key()

static SourceEncryptionKey google::cloud::storage::SourceEncryptionKey::FromBase64Key ( std::string const &  key)
static

Creates an encryption key parameter from a key in base64 format.

Parameters
keya base64-encoded key, must have exactly 32 bytes when decoded.

◆ FromBinaryKey()

static SourceEncryptionKey google::cloud::storage::SourceEncryptionKey::FromBinaryKey ( std::string const &  key)
static

Creates a source encryption key parameter from a binary key.

Parameters
keya binary key, must have exactly 32 bytes.

◆ prefix()

static char const* google::cloud::storage::SourceEncryptionKey::prefix ( )
inlinestatic

Definition at line 246 of file well_known_headers.h.