mirror of
https://github.com/PurpleI2P/i2pd-tools.git
synced 2025-01-22 21:37:18 +01:00
Merge pull request #70 from acetoneRu/master
user friendly mode for offlinekeys tool
This commit is contained in:
commit
b7e213331c
|
@ -42,6 +42,7 @@ int main (int argc, char * argv[])
|
||||||
{
|
{
|
||||||
std::string str(argv[3]);
|
std::string str(argv[3]);
|
||||||
type = NameToSigType(str);
|
type = NameToSigType(str);
|
||||||
|
if (SigTypeToName(type).find("unknown") != std::string::npos) { std::cerr << "Incorrect signature type" << std::endl; return -2; }
|
||||||
}
|
}
|
||||||
|
|
||||||
int days = 365; // 1 year by default
|
int days = 365; // 1 year by default
|
||||||
|
@ -58,7 +59,9 @@ int main (int argc, char * argv[])
|
||||||
len = offlineKeys.ToBuffer (buf, len);
|
len = offlineKeys.ToBuffer (buf, len);
|
||||||
f.write ((char *)buf, len);
|
f.write ((char *)buf, len);
|
||||||
delete[] buf;
|
delete[] buf;
|
||||||
std::cout << "Offline keys for destination " << offlineKeys.GetPublic ()->GetIdentHash ().ToBase32 () << " created" << std::endl;
|
std::cout << "Offline keys for destination " << offlineKeys.GetPublic ()->GetIdentHash ().ToBase32 () << " created" << std::endl
|
||||||
|
<< "Signature type: " << SigTypeToName(type) << " (" << type << ")" << std::endl
|
||||||
|
<< "Days: " << days << std::endl;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
std::cout << "Can't create file " << argv[1] << std::endl;
|
std::cout << "Can't create file " << argv[1] << std::endl;
|
||||||
|
@ -67,4 +70,3 @@ int main (int argc, char * argv[])
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue