update certificate request data structure
Change-Id: Id73428d07e6a0315dcdf78da8aba380f429a8f46
diff --git a/src/ndncert-common.cpp b/src/ndncert-common.cpp
index fc0e9c6..086d880 100644
--- a/src/ndncert-common.cpp
+++ b/src/ndncert-common.cpp
@@ -62,5 +62,22 @@
}
}
+std::string
+convertJson2String(const JsonSection& json)
+{
+ std::stringstream ss;
+ boost::property_tree::write_json(ss, json);
+ return ss.str();
+}
+
+JsonSection
+convertString2Json(const std::string& jsonContent)
+{
+ std::istringstream ss(jsonContent);
+ JsonSection json;
+ boost::property_tree::json_parser::read_json(ss, json);
+ return json;
+}
+
} // namespace ndncert
} // namespace ndn