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

Function parseEncrypted

libminifi/src/utils/EncryptionUtils.cpp:115–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115EncryptedData parseEncrypted(const std::string& input) {
116 std::vector<std::string> nonce_and_rest = utils::StringUtils::split(input, EncryptionType::separator());
117 if (nonce_and_rest.size() != 2) {
118 throw std::invalid_argument{"Incorrect input; expected '<nonce>" + EncryptionType::separator() + "<ciphertext_plus_mac>'"};
119 }
120
121 Bytes nonce = utils::StringUtils::from_base64(nonce_and_rest[0].data(), nonce_and_rest[0].size());
122 Bytes ciphertext_plus_mac = utils::StringUtils::from_base64(nonce_and_rest[1].data(), nonce_and_rest[1].size());
123
124 return EncryptedData{nonce, ciphertext_plus_mac};
125}
126
127bool isEncrypted(const std::string& input) {
128 try {

Callers 2

decryptFunction · 0.85
isEncryptedFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected