* Class representing a TileDB encryption algorithm object. * * @details * An EncryptionAlgorithm represents a pair of encryption type and key. * * @code{.cpp} * // Open an array with an EncryptionAlgorithm * tiledb::Context ctx; * std::string key = "0123456789"; * tiledb::Array array( * ctx, * "s3://bucket/array", * TILEDB_WRITE, * TemporalPolicy(), * EncryptionAlgorit
| 137 | * @endcode |
| 138 | */ |
| 139 | class EncryptionAlgorithm { |
| 140 | /** |
| 141 | * Make available the internals of EncryptionAlgorithm to Array. |
| 142 | */ |
| 143 | friend class Array; |
| 144 | |
| 145 | public: |
| 146 | EncryptionAlgorithm() |
| 147 | : type_(TILEDB_NO_ENCRYPTION) |
| 148 | , key_(nullptr) {}; |
| 149 | |
| 150 | EncryptionAlgorithm(tiledb_encryption_type_t type, const char* key) |
| 151 | : type_(type) |
| 152 | , key_(key) {}; |
| 153 | |
| 154 | EncryptionAlgorithm(const AESGCMEncryptionTypeMarker&, const char* key) |
| 155 | : type_(TILEDB_AES_256_GCM) |
| 156 | , key_(key) {}; |
| 157 | |
| 158 | private: |
| 159 | inline tiledb_encryption_type_t type() const { |
| 160 | return type_; |
| 161 | } |
| 162 | |
| 163 | inline const char* key() const { |
| 164 | return key_; |
| 165 | } |
| 166 | |
| 167 | const tiledb_encryption_type_t type_; |
| 168 | const char* key_; |
| 169 | }; |
| 170 | |
| 171 | /** |
| 172 | * Class representing a TileDB array object. |
no outgoing calls
no test coverage detected