| 41 | } // namespace |
| 42 | |
| 43 | utils::optional<EncryptionProvider> EncryptionProvider::create(const std::string& home_path) { |
| 44 | minifi::Properties bootstrap_conf; |
| 45 | bootstrap_conf.setHome(home_path); |
| 46 | bootstrap_conf.loadConfigureFile(DEFAULT_NIFI_BOOTSTRAP_FILE); |
| 47 | return bootstrap_conf.getString(CONFIG_ENCRYPTION_KEY_PROPERTY_NAME) |
| 48 | | utils::map([](const std::string &encryption_key_hex) { return utils::StringUtils::from_hex(encryption_key_hex); }) |
| 49 | | utils::map(&utils::crypto::stringToBytes) |
| 50 | | utils::map([](const utils::crypto::Bytes &encryption_key_bytes) { return EncryptionProvider{encryption_key_bytes}; }); |
| 51 | } |
| 52 | |
| 53 | } // namespace crypto |
| 54 | } // namespace utils |
nothing calls this directly
no test coverage detected