| 154 | } |
| 155 | |
| 156 | void EncryptConfig::writeEncryptionKeyToBootstrapFile(const utils::crypto::Bytes& encryption_key) const { |
| 157 | std::string key_encoded = utils::StringUtils::to_hex(utils::crypto::bytesToString(encryption_key)); |
| 158 | encrypt_config::ConfigFile bootstrap_file{std::ifstream{bootstrapFilePath()}}; |
| 159 | |
| 160 | if (bootstrap_file.hasValue(ENCRYPTION_KEY_PROPERTY_NAME)) { |
| 161 | bootstrap_file.update(ENCRYPTION_KEY_PROPERTY_NAME, key_encoded); |
| 162 | } else { |
| 163 | bootstrap_file.append(ENCRYPTION_KEY_PROPERTY_NAME, key_encoded); |
| 164 | } |
| 165 | |
| 166 | bootstrap_file.writeTo(bootstrapFilePath()); |
| 167 | } |
| 168 | |
| 169 | void EncryptConfig::encryptSensitiveProperties(const EncryptionKeys& keys) const { |
| 170 | encrypt_config::ConfigFile properties_file{std::ifstream{propertiesFilePath()}}; |
nothing calls this directly
no test coverage detected