version 0.1.10
[fms.git] / include / http / identityexportxml.h
1 #ifndef _identityexportxml_\r
2 #define _identityexportxml_\r
3 \r
4 #include "../ifmsxmldocument.h"\r
5 \r
6 class IdentityExportXML:public IFMSXMLDocument\r
7 {\r
8 public:\r
9         IdentityExportXML();\r
10 \r
11         std::string GetXML();\r
12         const bool ParseXML(const std::string &xml);\r
13 \r
14         void AddIdentity(const std::string &name, const std::string &publickey, const std::string &privatekey, const bool singleuse=false, const bool publishtrustlist=false, const bool publishboardlist=false);\r
15 \r
16         const long GetCount()           { return m_identities.size(); }\r
17 \r
18         const std::string GetName(const long index);\r
19         const std::string GetPublicKey(const long index);\r
20         const std::string GetPrivateKey(const long index);\r
21         const bool GetSingleUse(const long index);\r
22         const bool GetPublishTrustList(const long index);\r
23         const bool GetPublishBoardList(const long index);\r
24 \r
25 private:\r
26         void Initialize();\r
27 \r
28         struct identity\r
29         {\r
30                 identity(const std::string &name, const std::string &publickey, const std::string &privatekey, const bool singleuse, const bool publishtrustlist, const bool publishboardlist):m_name(name),m_publickey(publickey),m_privatekey(privatekey),m_singleuse(singleuse),m_publishtrustlist(publishtrustlist),m_publishboardlist(publishboardlist)    {}\r
31                 std::string m_name;\r
32                 std::string m_publickey;\r
33                 std::string m_privatekey;\r
34                 bool m_singleuse;\r
35                 bool m_publishtrustlist;\r
36                 bool m_publishboardlist;\r
37         };\r
38 \r
39         std::vector<identity> m_identities;\r
40 \r
41 };\r
42 \r
43 #endif  // _identityexportxml_\r