1 #include "../../include/freenet/identityintroductionxml.h"
\r
2 #include "../../include/freenet/freenetssk.h"
\r
8 IdentityIntroductionXML::IdentityIntroductionXML()
\r
13 std::string IdentityIntroductionXML::GetXML()
\r
15 Poco::AutoPtr<Poco::XML::Document> doc=new Poco::XML::Document;
\r
16 Poco::AutoPtr<Poco::XML::Element> root=doc->createElement("IdentityIntroduction");
\r
18 doc->appendChild(root);
\r
20 root->appendChild(XMLCreateCDATAElement(doc,"Identity",m_identity));
\r
22 return GenerateXML(doc);
\r
25 void IdentityIntroductionXML::Initialize()
\r
30 const bool IdentityIntroductionXML::ParseXML(const std::string &xml)
\r
34 Poco::XML::DOMParser dp;
\r
40 Poco::AutoPtr<Poco::XML::Document> doc=dp.parseString(FixCDATA(xml));
\r
41 Poco::XML::Element *root=XMLGetFirstChild(doc,"IdentityIntroduction");
\r
42 Poco::XML::Element *txt=NULL;
\r
44 txt=XMLGetFirstChild(root,"Identity");
\r
47 if(txt->firstChild())
\r
49 m_identity=SanitizeSingleString(txt->firstChild()->getNodeValue());
\r
53 ssk.SetPublicKey(m_identity);
\r
54 if(ssk.ValidPublicKey()==false)
\r