iceberg-cpp
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
iceberg::StandardKeyMetadata Struct Reference

Per-file key metadata of the standard encryption scheme. More...

#include <standard_key_metadata.h>

Public Member Functions

std::vector< uint8_t > Serialize () const
 Serialize to the version-prefixed Avro binary form.
 
StandardKeyMetadata WithFileLength (int64_t length) const
 Return a copy with the given encrypted file length.
 

Static Public Member Functions

static Result< StandardKeyMetadata > Parse (std::span< const uint8_t > buffer)
 Parse serialized key metadata.
 

Public Attributes

std::vector< uint8_t > encryption_key
 The data encryption key (16, 24 or 32 bytes).
 
std::optional< std::vector< uint8_t > > aad_prefix
 The AAD prefix (file ID) used to bind ciphertext to this file.
 
std::optional< int64_t > file_length
 The encrypted (stored) file length, required to read AES GCM streams.
 

Static Public Attributes

static constexpr uint8_t kV1 = 1
 

Friends

bool operator== (const StandardKeyMetadata &, const StandardKeyMetadata &)=default
 

Detailed Description

Per-file key metadata of the standard encryption scheme.

Stored in the key_metadata field of data files, delete files and manifest files, and (encrypted by a key encryption key) in the table metadata encryption-keys for manifest lists.

The Iceberg table spec leaves the key metadata representation to the encryption scheme; it mandates neither this encoding nor AES-GCM. The schema below follows Java's standard scheme.

The serialized form is compatible with Java's StandardKeyMetadata: a one-byte schema version (1) followed by an Avro binary encoded record with the fields encryption_key: bytes, aad_prefix: union{null, bytes} and file_length: union{null, long}.


The documentation for this struct was generated from the following file: