1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
11 #include <anna/core/core.hpp>
13 #include <anna/xml/Node.hpp>
14 #include <anna/xml/Parser.hpp>
15 #include <anna/xml/DocumentFile.hpp>
16 #include <anna/xml/functions.hpp>
18 #include <anna/app/Application.hpp>
20 #include <anna/core/util/Encoder.hpp>
22 class Test : public app::Application {
26 void initialize () noexcept(false);
29 void run () noexcept(false);
34 int main (int argc, const char** argv)
36 CommandLine& commandLine (CommandLine::instantiate ());
40 commandLine.initialize (argv, argc);
41 commandLine.verify ();
45 catch (Exception& ex) {
46 cout << ex.asString () << endl;
53 app::Application ("GenerateLogOn", "Database login keys visualizer", "1.0.0")
55 CommandLine& commandLine (CommandLine::instantiate ());
57 commandLine.add ("logon", CommandLine::Argument::Mandatory, "XML document with user/password encrypted");
60 void Test::initialize ()
63 Encoder::initialize ();
64 xml::functions::initialize ();
70 CommandLine& commandLine (CommandLine::instantiate ());
72 xml::DocumentFile xmlDocument;
73 xml::Parser xmlParser;
77 xmlDocument.initialize (commandLine.getValue ("logon"));
79 const xml::Node* root = xmlParser.apply (xmlDocument);
81 edata.initialize (root->find ("User"));
82 const DataBlock& user = encoder.decode (edata);
83 cout << "User: " << user.getData () << endl;
85 edata.initialize (root->find ("Password"));
86 const DataBlock& password = encoder.decode (edata);
87 cout << "Password: " << password.getData () << endl << endl;