diff --git a/cpp/src/parquet/encryption/internal_file_decryptor.cc b/cpp/src/parquet/encryption/internal_file_decryptor.cc index 33d796a94447f..bb8afd258af8f 100644 --- a/cpp/src/parquet/encryption/internal_file_decryptor.cc +++ b/cpp/src/parquet/encryption/internal_file_decryptor.cc @@ -64,6 +64,10 @@ InternalFileDecryptor::InternalFileDecryptor(FileDecryptionProperties* propertie properties_->set_utilized(); } +void InternalFileDecryptor::WipeOutDecryptionKeys() { + properties_->WipeOutDecryptionKeys(); +} + std::string InternalFileDecryptor::GetFooterKey() { std::string footer_key = properties_->footer_key(); // ignore footer key metadata if footer key is explicitly set via API diff --git a/cpp/src/parquet/encryption/internal_file_decryptor.h b/cpp/src/parquet/encryption/internal_file_decryptor.h index 06a5a0368ac8e..56967d7313cbd 100644 --- a/cpp/src/parquet/encryption/internal_file_decryptor.h +++ b/cpp/src/parquet/encryption/internal_file_decryptor.h @@ -19,7 +19,6 @@ #include #include -#include #include #include @@ -76,6 +75,8 @@ class InternalFileDecryptor { FileDecryptionProperties* properties() { return properties_; } + void WipeOutDecryptionKeys(); + ::arrow::MemoryPool* pool() { return pool_; } std::shared_ptr GetFooterDecryptor(); diff --git a/cpp/src/parquet/encryption/internal_file_encryptor.cc b/cpp/src/parquet/encryption/internal_file_encryptor.cc index 80ec6412fd6e5..28785521bbd0b 100644 --- a/cpp/src/parquet/encryption/internal_file_encryptor.cc +++ b/cpp/src/parquet/encryption/internal_file_encryptor.cc @@ -50,6 +50,10 @@ InternalFileEncryptor::InternalFileEncryptor(FileEncryptionProperties* propertie properties_->set_utilized(); } +void InternalFileEncryptor::WipeOutEncryptionKeys() { + properties_->WipeOutEncryptionKeys(); +} + std::shared_ptr InternalFileEncryptor::GetFooterEncryptor() { if (footer_encryptor_ != nullptr) { return footer_encryptor_; diff --git a/cpp/src/parquet/encryption/internal_file_encryptor.h b/cpp/src/parquet/encryption/internal_file_encryptor.h index a7108ab66f610..5a3d743ce5365 100644 --- a/cpp/src/parquet/encryption/internal_file_encryptor.h +++ b/cpp/src/parquet/encryption/internal_file_encryptor.h @@ -77,6 +77,7 @@ class InternalFileEncryptor { std::shared_ptr GetFooterSigningEncryptor(); std::shared_ptr GetColumnMetaEncryptor(const std::string& column_path); std::shared_ptr GetColumnDataEncryptor(const std::string& column_path); + void WipeOutEncryptionKeys(); private: FileEncryptionProperties* properties_;