added key generation

master
nkls 1 year ago
parent 04a3ca5c47
commit 202bea2660

@ -1,23 +0,0 @@
magnet link
.torrent file
DHT (Kademlia)
PEX
tracker
peer ID
uTP
magnet:?xt=urn:btih:716E3D502B49B128781D12F7C8B58B1770CC5DE1&dn=Doctor%20Who%201963%20Season%2022%20Complete%20x264%20%5Bi_c%5D&tr=udp%3A%2F%2F
tracker.coppersurfer.tk%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A6969%2Fannounce&tr=udp%3A%2F%2F
tracker.opentrackr.org%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969%2Fannounce&tr=udp%3A%2F%2F
tracker.dler.org%3A6969%2Fannounce&tr=udp%3A%2F%2F
opentracker.i2p.rocks%3A6969%2Fannounce&tr=udp%3A%2F%2F47.ip-51-68-199.eu%3A6969%2Fannounce
magnet:?xt=urn:btih:D540FC48EB12F2833163EED6421D449DD8F1CE1F&dn=Ubuntu%20desktop%2019.04%20(64bit)
==============================================================================================================================

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -31,15 +31,19 @@ class mix
this->read_settings();
std::cout << "name = " << name << std::endl;
std::cout << "id = " << id << std::endl;
read_keys();
// read_keys();
}
else
{
std::cout << "Config file does not exist. Exiting." << std::endl;
std::exit(1);
}
std::cout << "Looking for keys" << std::endl;
gpgme_check_version(NULL);
gpgme_new(&context);
create_keys();
}
void read_settings()
{
@ -53,11 +57,9 @@ class mix
po::notify(vm);
}
void read_keys()
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)
@ -75,6 +77,19 @@ class mix
}
}
}
void create_keys()
{
error=gpgme_op_createkey(context,"mix@pep.foundation",NULL,0,0,NULL,0);
if(error)
{
std::cout << "Error generating keys" << error << std::endl;
}
else
{
std::cout << "Key generated successfully" << std::endl;
}
}
};

Loading…
Cancel
Save