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

Method CreateKeyEncryptionKey

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

Source from the content-addressed store, hash-verified

112}
113
114KeyEncryptionKey FileKeyWrapper::CreateKeyEncryptionKey(
115 const std::string& master_key_id) {
116 SecureString kek_bytes(kKeyEncryptionKeyLength, '\0');
117 RandBytes(kek_bytes.as_span().data(), kKeyEncryptionKeyLength);
118
119 std::string kek_id(kKeyEncryptionKeyIdLength, '\0');
120 RandBytes(reinterpret_cast<uint8_t*>(kek_id.data()), kKeyEncryptionKeyIdLength);
121
122 // Encrypt KEK with Master key
123 std::string encoded_wrapped_kek = kms_client_->WrapKey(kek_bytes, master_key_id);
124
125 return KeyEncryptionKey(std::move(kek_bytes), std::move(kek_id),
126 std::move(encoded_wrapped_kek));
127}
128
129} // namespace parquet::encryption

Callers 1

Calls 5

KeyEncryptionKeyClass · 0.85
as_spanMethod · 0.80
RandBytesFunction · 0.70
dataMethod · 0.45
WrapKeyMethod · 0.45

Tested by

no test coverage detected