MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / writeEncryptionKeyToBootstrapFile

Method writeEncryptionKeyToBootstrapFile

encrypt-config/EncryptConfig.cpp:156–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156void 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
169void EncryptConfig::encryptSensitiveProperties(const EncryptionKeys& keys) const {
170 encrypt_config::ConfigFile properties_file{std::ifstream{propertiesFilePath()}};

Callers

nothing calls this directly

Calls 5

bytesToStringFunction · 0.85
hasValueMethod · 0.80
writeToMethod · 0.80
updateMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected