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

Function GetCryptoFactory

cpp/examples/arrow/parquet_column_encryption.cc:64–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64std::shared_ptr<parquet::encryption::CryptoFactory> GetCryptoFactory() {
65 // Configure KMS.
66 std::unordered_map<std::string, arrow::util::SecureString> key_map;
67 key_map.emplace("footerKeyId", arrow::util::SecureString("0123456789012345"));
68 key_map.emplace("columnKeyId", arrow::util::SecureString("1234567890123456"));
69
70 auto crypto_factory = std::make_shared<parquet::encryption::CryptoFactory>();
71 auto kms_client_factory =
72 // for testing only, do not use it as an example of KmsClientFactory implementation
73 std::make_shared<parquet::encryption::TestOnlyInMemoryKmsClientFactory>(
74 /*wrap_locally=*/true, key_map);
75 crypto_factory->RegisterKmsClientFactory(std::move(kms_client_factory));
76 return crypto_factory;
77}
78
79arrow::Status WriteEncryptedFile(const std::string& path_to_file) {
80 using arrow::internal::checked_pointer_cast;

Callers 2

WriteEncryptedFileFunction · 0.85
ReadEncryptedFileFunction · 0.85

Calls 2

SecureStringFunction · 0.85

Tested by

no test coverage detected