xanderbailey commented on code in PR #16527:
URL: https://github.com/apache/iceberg/pull/16527#discussion_r3846105413


##########
format/encryption-spec.md:
##########
@@ -0,0 +1,77 @@
+---
+title: "Encryption Spec"
+---
+<!--
+ - Licensed to the Apache Software Foundation (ASF) under one or more
+ - contributor license agreements.  See the NOTICE file distributed with
+ - this work for additional information regarding copyright ownership.
+ - The ASF licenses this file to You under the Apache License, Version 2.0
+ - (the "License"); you may not use this file except in compliance with
+ - the License.  You may obtain a copy of the License at
+ -
+ -   http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing, software
+ - distributed under the License is distributed on an "AS IS" BASIS,
+ - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ - See the License for the specific language governing permissions and
+ - limitations under the License.
+ -->
+
+# Iceberg Encryption Spec
+
+This document specifies the standard encryption scheme for Apache Iceberg 
tables. It defines the interoperable, cross-implementation binary format for 
per-file encryption key material referenced by the `key_metadata` fields in the 
[table spec](spec.md), along with the key hierarchy used to manage those keys.
+
+Encrypted key material is tracked in two places:
+
+* The `key_metadata` fields in [manifest entries](spec.md#manifests), 
[manifest list entries](spec.md#manifest-lists), and [statistics 
files](spec.md#table-metadata-fields) store the per-file key material.
+* The table metadata [`encryption-keys`](spec.md#encryption-keys) list tracks 
the key hierarchy used to protect that per-file material.
+
+## Standard Key Metadata
+
+The `key_metadata` field in manifest entries stores per-file encryption key 
material as a binary blob. To enable cross-implementation interoperability, the 
standard encryption scheme defines the following binary format for this field:
+
+```
+VersionByte Payload
+```
+
+where:
+
+* `VersionByte` is a single byte indicating the key metadata schema version. 
Currently, the only valid version is `0x01`.
+* `Payload` is an Avro binary-encoded record (not a container file — only the 
raw binary encoding of the fields) using the schema for the given version.

Review Comment:
   
https://github.com/apache/iceberg-rust/blob/4908b0b1d160043c9b8a4e1da160e72e85610812/crates/iceberg/src/encryption/key_metadata.rs#L143-L168
   
   This is the rust implementation and it works correctly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to