patch_solution_since_16.0.7.0.generic.cpp 560 B

1234567891011121314151617
  1. #include "patch_solution_since_16.0.7.0.hpp"
  2. #include <regex>
  3. namespace nkg {
  4. std::string patch_solution_since<16, 0, 7, 0>::_build_encoded_key(const rsa_cipher& cipher) {
  5. auto encoded_key = cipher.export_public_key_string_pem();
  6. encoded_key = std::regex_replace(encoded_key, std::regex("-----BEGIN PUBLIC KEY-----"), "");
  7. encoded_key = std::regex_replace(encoded_key, std::regex("-----END PUBLIC KEY-----"), "");
  8. encoded_key = std::regex_replace(encoded_key, std::regex("\n"), "");
  9. return encoded_key;
  10. }
  11. }