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

Method UnwrapKey

cpp/src/parquet/encryption/local_wrap_kms_client.cc:87–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87SecureString LocalWrapKmsClient::UnwrapKey(const std::string& wrapped_key,
88 const std::string& master_key_identifier) {
89 LocalKeyWrap key_wrap = LocalKeyWrap::Parse(wrapped_key);
90 const std::string& master_key_version = key_wrap.master_key_version();
91 if (kLocalWrapNoKeyVersion != master_key_version) {
92 throw ParquetException("Master key versions are not supported for local wrapping: " +
93 master_key_version);
94 }
95 const std::string& encrypted_encoded_key = key_wrap.encrypted_encoded_key();
96 const SecureString& master_key = master_key_cache_.GetOrInsert(
97 master_key_identifier, [this, master_key_identifier]() -> const SecureString& {
98 return this->GetKeyFromServer(master_key_identifier);
99 });
100 const std::string& aad = master_key_identifier;
101
102 return internal::DecryptKeyLocally(encrypted_encoded_key, master_key, aad);
103}
104
105const SecureString& LocalWrapKmsClient::GetKeyFromServer(
106 const std::string& key_identifier) {

Callers

nothing calls this directly

Calls 5

ParquetExceptionFunction · 0.85
DecryptKeyLocallyFunction · 0.85
master_key_versionMethod · 0.80
ParseFunction · 0.50
GetOrInsertMethod · 0.45

Tested by

no test coverage detected