pitrou commented on code in PR #46017:
URL: https://github.com/apache/arrow/pull/46017#discussion_r2194773454


##########
cpp/src/parquet/encryption/encryption.h:
##########
@@ -310,18 +325,22 @@ class PARQUET_EXPORT FileDecryptionProperties {
   }
 
  private:
-  std::string footer_key_;
+  ::arrow::util::SecureString footer_key_;
   std::string aad_prefix_;
   std::shared_ptr<AADPrefixVerifier> aad_prefix_verifier_;
 
+  // any empty SecureString key is interpreted as if no key is given
+  // this instance is used if a SecureString reference is returned
+  const ::arrow::util::SecureString no_key_ = ::arrow::util::SecureString();

Review Comment:
   Does this need to be an instance variable? It could just be a private 
constant inside `encryption.cc`



##########
cpp/src/parquet/encryption/encryption.h:
##########
@@ -46,28 +48,39 @@ using ColumnPathToEncryptionPropertiesMap =
 
 class PARQUET_EXPORT DecryptionKeyRetriever {
  public:
-  virtual std::string GetKey(const std::string& key_metadata) = 0;
+  /// \brief Retrieve a key.
+  virtual ::arrow::util::SecureString GetKey(const std::string& key_id) = 0;
+
   virtual ~DecryptionKeyRetriever() {}
 };
 
 /// Simple integer key retriever
 class PARQUET_EXPORT IntegerKeyIdRetriever : public DecryptionKeyRetriever {
  public:
-  void PutKey(uint32_t key_id, const std::string& key);
-  std::string GetKey(const std::string& key_metadata) override;
+  void PutKey(uint32_t key_id, ::arrow::util::SecureString key);
+
+  ::arrow::util::SecureString GetKey(const std::string& key_id_string) 
override {
+    // key_id_string is string but for IntegerKeyIdRetriever it encodes

Review Comment:
   I'm not sure it's worth inlining this method, is it? Especially as it will 
usually be called through the vtable, anyway.



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to