Now I want to generate one encrypted XML file through Boost ptree
.
using boost::property_tree::ptree;
ptree pt;
pt.add("License.Unalterable.Signed.Guid", m_Guid);
pt.add("License.Unalterable.Signed.CustomerId", m_CustomerId);
pt.add("License.Unalterable.Signed.Name", m_Name);
pt.add("License.Unalterable.Signed.Version", m_version);
write_xml(licenseFileName, pt);
I want to encrypt the whole xml file before write_xml()
is called. Through reading the codes of write_xml
, I know the xml nodes are read from ptree one by one, then write them into fstream
immediately one by one. Is there any way to get the whole xml data stream before write it to file? so that I can encrypt the whole data stream, then write them to file.
Currently, My solution is that reread this xml file after created by write_xml
, then write it back after encrypting the xml content.
No comments:
Post a Comment