Skip to content

Commit

Permalink
Restore properties_->WipeOut[De|En]cryptionKeys()
Browse files Browse the repository at this point in the history
  • Loading branch information
EnricoMi committed Dec 11, 2024
1 parent 56bd0c7 commit 4ee9f18
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cpp/src/parquet/encryption/internal_file_decryptor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion cpp/src/parquet/encryption/internal_file_decryptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

#include <map>
#include <memory>
#include <mutex>
#include <string>
#include <vector>

Expand Down Expand Up @@ -76,6 +75,8 @@ class InternalFileDecryptor {

FileDecryptionProperties* properties() { return properties_; }

void WipeOutDecryptionKeys();

::arrow::MemoryPool* pool() { return pool_; }

std::shared_ptr<Decryptor> GetFooterDecryptor();
Expand Down
4 changes: 4 additions & 0 deletions cpp/src/parquet/encryption/internal_file_encryptor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ InternalFileEncryptor::InternalFileEncryptor(FileEncryptionProperties* propertie
properties_->set_utilized();
}

void InternalFileEncryptor::WipeOutEncryptionKeys() {
properties_->WipeOutEncryptionKeys();
}

std::shared_ptr<Encryptor> InternalFileEncryptor::GetFooterEncryptor() {
if (footer_encryptor_ != nullptr) {
return footer_encryptor_;
Expand Down
1 change: 1 addition & 0 deletions cpp/src/parquet/encryption/internal_file_encryptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class InternalFileEncryptor {
std::shared_ptr<Encryptor> GetFooterSigningEncryptor();
std::shared_ptr<Encryptor> GetColumnMetaEncryptor(const std::string& column_path);
std::shared_ptr<Encryptor> GetColumnDataEncryptor(const std::string& column_path);
void WipeOutEncryptionKeys();

private:
FileEncryptionProperties* properties_;
Expand Down

0 comments on commit 4ee9f18

Please sign in to comment.