mirror of
https://github.com/PurpleI2P/i2pd-tools.git
synced 2025-01-22 13:27:17 +01:00
keygen in user friendly mode
This commit is contained in:
parent
263809be18
commit
9618b20939
|
@ -17,6 +17,7 @@ int main (int argc, char * argv[])
|
|||
if (argc > 2) {
|
||||
std::string str(argv[2]);
|
||||
type = NameToSigType(str);
|
||||
if (SigTypeToName(type).find("unknown") != std::string::npos) { std::cerr << "Incorrect signature type" << std::endl; return -2; }
|
||||
}
|
||||
auto keys = i2p::data::PrivateKeys::CreateRandomKeys (type);
|
||||
std::ofstream f (argv[1], std::ofstream::binary | std::ofstream::out);
|
||||
|
@ -28,6 +29,7 @@ int main (int argc, char * argv[])
|
|||
f.write ((char *)buf, len);
|
||||
delete[] buf;
|
||||
std::cout << "Destination " << keys.GetPublic ()->GetIdentHash ().ToBase32 () << " created" << std::endl;
|
||||
std::cout << "Signature type: " << SigTypeToName(type) << " (" << type << ")" << std::endl;
|
||||
}
|
||||
else
|
||||
std::cout << "Can't create file " << argv[1] << std::endl;
|
||||
|
|
Loading…
Reference in a new issue