| 456 | } |
| 457 | |
| 458 | String CompressionCodecEncrypted::Configuration::getKey(EncryptionMethod method, const UInt64 & key_id) const |
| 459 | { |
| 460 | String key; |
| 461 | /// See description of previous finction, logic is the same. |
| 462 | if (!params.get()) |
| 463 | throw Exception(ErrorCodes::BAD_ARGUMENTS, "Empty params in CompressionCodecEncrypted configuration"); |
| 464 | |
| 465 | const auto current_params = params.get(); |
| 466 | |
| 467 | /// check if there is current key in storage |
| 468 | if (current_params->keys_storage[method].contains(key_id)) |
| 469 | key = current_params->keys_storage[method].at(key_id); |
| 470 | else |
| 471 | throw Exception(ErrorCodes::BAD_ARGUMENTS, "There is no key {} in config for {} encryption codec", key_id, getMethodName(method)); |
| 472 | |
| 473 | return key; |
| 474 | } |
| 475 | |
| 476 | |
| 477 | CompressionCodecEncrypted::CompressionCodecEncrypted(EncryptionMethod Method): encryption_method(Method) |
no test coverage detected