2015-02-05 12:55:48 +00:00
|
|
|
#include <ctime>
|
|
|
|
|
#include <fstream>
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
|
|
#include "crypto.h"
|
|
|
|
|
|
|
|
|
|
int main(int argc, char *argv[]) {
|
|
|
|
|
if (argc < 3) {
|
2015-02-05 13:04:36 +00:00
|
|
|
std::cerr << "Usage: " << argv[0] << " secret_key_filename public_key_filename" << std::endl;
|
2015-02-05 12:55:48 +00:00
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-05 13:04:36 +00:00
|
|
|
std::string secret_key, public_key;
|
2015-02-07 14:32:53 -08:00
|
|
|
CryptoUtil::GenKeyPair(&secret_key, &public_key);
|
2015-02-05 12:55:48 +00:00
|
|
|
|
2015-02-07 14:32:53 -08:00
|
|
|
CryptoUtil::WriteKeyToFile(argv[1], secret_key);
|
|
|
|
|
CryptoUtil::WriteKeyToFile(argv[2], public_key);
|
2015-02-05 12:55:48 +00:00
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|