diff --git a/.~lock.slides.odp# b/.~lock.slides.odp# deleted file mode 100644 index 91eb9e4..0000000 --- a/.~lock.slides.odp# +++ /dev/null @@ -1 +0,0 @@ -,nkls,peppi,17.08.2021 16:34,file:///home/nkls/.config/libreoffice/4; \ No newline at end of file diff --git a/linuxmint-19-cinnamon-32bit.iso.torrent b/linuxmint-19-cinnamon-32bit.iso.torrent deleted file mode 100644 index a10528c..0000000 Binary files a/linuxmint-19-cinnamon-32bit.iso.torrent and /dev/null differ diff --git a/src/.mix.cpp.swp b/src/.mix.cpp.swp new file mode 100644 index 0000000..0c53b9b Binary files /dev/null and b/src/.mix.cpp.swp differ diff --git a/src/keys.gpg b/src/keys.gpg new file mode 100644 index 0000000..3e2bc43 Binary files /dev/null and b/src/keys.gpg differ diff --git a/src/mix b/src/mix new file mode 100755 index 0000000..08114f1 Binary files /dev/null and b/src/mix differ diff --git a/src/mix.conf b/src/mix.conf new file mode 100644 index 0000000..9fdeafb --- /dev/null +++ b/src/mix.conf @@ -0,0 +1,3 @@ +name = mix1 +id = 1 + diff --git a/src/mix.cpp b/src/mix.cpp new file mode 100644 index 0000000..4df88c1 --- /dev/null +++ b/src/mix.cpp @@ -0,0 +1,87 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace po=boost::program_options; + +class mix + { + public: + int id; + std::string name; + char *privkey; + char *pubkey; + gpgme_data_t keydata; + gpgme_ctx_t context; + gpgme_error_t error; + gpgme_key_t key; + void init() + { + std::cout << "Mix starting..." << std::endl; + if(std::ifstream("mix.conf")) + { + std::cout << "Config file existing" << std::endl; + this->read_settings(); + std::cout << "name = " << name << std::endl; + std::cout << "id = " << id << std::endl; + read_keys(); + } + else + { + std::cout << "Config file does not exist. Exiting." << std::endl; + std::exit(1); + } + } + + void read_settings() + + { + po::options_description desc("Options"); + desc.add_options() ("name", po::value(&name), "name"); + desc.add_options() ("id", po::value(&id), "id"); + po::variables_map vm; + std::ifstream settings_file("mix.conf"); + vm = po::variables_map(); + po::store(po::parse_config_file(settings_file , desc), vm); + po::notify(vm); + } + + void read_keys() + { + gpgme_data_new_from_file(&keydata, "keys.gpg", 1); + gpgme_check_version(NULL); + gpgme_new(&context); + gpgme_op_import(context, keydata); + gpgme_op_keylist_start (context, "mix", 0); + while(!error) + { + error = gpgme_op_keylist_next (context, &key); + if (error){break;} + std::cout << key->subkeys->keyid << std::endl; + if (key->uids && key->uids->name) + { + std::cout << key->uids->name << std::endl; + } + if (key->uids && key->uids->email) + { + std::cout << key->uids->email << std::endl; + } + } + } + }; + + +int main() + { + mix mix1; + mix1.init(); + } + +