huaxingao commented on code in PR #14396:
URL: https://github.com/apache/iceberg/pull/14396#discussion_r2462327336


##########
core/src/main/java/org/apache/iceberg/encryption/EncryptionUtil.java:
##########
@@ -117,14 +117,26 @@ public static ByteBuffer decryptManifestListKeyMetadata(
         "Snapshot key metadata encryption requires a 
StandardEncryptionManager");
     StandardEncryptionManager sem = (StandardEncryptionManager) em;
     String manifestListKeyId = manifestList.encryptionKeyID();
+    Map<String, EncryptedKey> encryptionKeys = sem.encryptionKeys();
+    EncryptedKey manifestListKey = encryptionKeys.get(manifestListKeyId);
+    ByteBuffer encryptedKeyMetadata = manifestListKey.encryptedKeyMetadata();
+    String keyEncryptionKeyID = manifestListKey.encryptedById();
     ByteBuffer keyEncryptionKey = sem.encryptedByKey(manifestListKeyId);
-    ByteBuffer encryptedKeyMetadata = 
sem.encryptedKeyMetadata(manifestListKeyId);
-
+    String keyEncryptionKeyTimestamp =
+        encryptionKeys
+            .get(keyEncryptionKeyID)
+            .properties()
+            .get(StandardEncryptionManager.KEY_TIMESTAMP);

Review Comment:
   Could this be null for the legacy KEKs? Could this cause NPE in L138?



-- 
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