Writing Encrypted Arrays

To write to an encrypted array, you simply need to open it for writing using the encryption key you used to create it.

// ... create context ctx

// Open encrypted array for writing
const char key[] = "0123456789abcdeF0123456789abcdeF";
tiledb_config_t* config;
tiledb_config_alloc(&config, &error);
tiledb_config_set(config, "sm.encryption_type", "AES_256_GCM", &error);
tiledb_config_set(config, "sm.encryption_key", key, &error);

tiledb_array_t* array;
tiledb_array_alloc(ctx, "<array-uri>", &array);
tiledb_array_set_config(ctx, array, config);
tiledb_array_open(ctx, array, TILEDB_WRITE);

Last updated