MCPcopy Create free account
hub / github.com/apache/arrow / FileKeyWrapper

Method FileKeyWrapper

cpp/src/parquet/encryption/file_key_wrapper.cc:29–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27namespace parquet::encryption {
28
29FileKeyWrapper::FileKeyWrapper(KeyToolkit* key_toolkit,
30 const KmsConnectionConfig& kms_connection_config,
31 std::shared_ptr<FileKeyMaterialStore> key_material_store,
32 double cache_entry_lifetime_seconds, bool double_wrapping)
33 : kms_connection_config_(kms_connection_config),
34 key_material_store_(key_material_store),
35 cache_entry_lifetime_seconds_(cache_entry_lifetime_seconds),
36 double_wrapping_(double_wrapping),
37 key_counter_(0) {
38 kms_connection_config_.SetDefaultIfEmpty();
39 // Check caches upon each file writing (clean once in cache_entry_lifetime_seconds_)
40 key_toolkit->kms_client_cache_per_token().CheckCacheForExpiredTokens(
41 cache_entry_lifetime_seconds_);
42 kms_client_ =
43 key_toolkit->GetKmsClient(kms_connection_config, cache_entry_lifetime_seconds_);
44
45 if (double_wrapping) {
46 key_toolkit->kek_write_cache_per_token().CheckCacheForExpiredTokens(
47 cache_entry_lifetime_seconds_);
48 kek_per_master_key_id_ =
49 key_toolkit->kek_write_cache_per_token().GetOrCreateInternalCache(
50 kms_connection_config.key_access_token(), cache_entry_lifetime_seconds_);
51 }
52}
53
54std::string FileKeyWrapper::GetEncryptionKeyMetadata(const SecureString& data_key,
55 const std::string& master_key_id,

Callers

nothing calls this directly

Calls 4

SetDefaultIfEmptyMethod · 0.80
GetKmsClientMethod · 0.80

Tested by

no test coverage detected