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

Method UnwrapKey

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

Source from the content-addressed store, hash-verified

91}
92
93SecureString LocalWrapKmsClient::UnwrapKey(const std::string& wrapped_key,
94 const std::string& master_key_identifier) {
95 LocalKeyWrap key_wrap = LocalKeyWrap::Parse(wrapped_key);
96 const std::string& master_key_version = key_wrap.master_key_version();
97 if (kLocalWrapNoKeyVersion != master_key_version) {
98 throw ParquetException("Master key versions are not supported for local wrapping: " +
99 master_key_version);
100 }
101 const std::string& encrypted_encoded_key = key_wrap.encrypted_encoded_key();
102 const SecureString& master_key = master_key_cache_.GetOrInsert(
103 master_key_identifier, [this, master_key_identifier]() -> const SecureString& {
104 return this->GetKeyFromServer(master_key_identifier);
105 });
106 const std::string& aad = master_key_identifier;
107
108 return internal::DecryptKeyLocally(encrypted_encoded_key, master_key, aad);
109}
110
111const SecureString& LocalWrapKmsClient::GetKeyFromServer(
112 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