Files
funstraw/gen-keypair.cc

24 lines
439 B
C++
Raw Normal View History

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-08 19:16:11 +00:00
sodium_init();
SecretKey secret_key;
PublicKey public_key;
CryptoUtil::GenKeyPair(&secret_key, &public_key);
2015-02-05 12:55:48 +00:00
secret_key.WriteToFile(argv[1]);
public_key.WriteToFile(argv[2]);
2015-02-05 12:55:48 +00:00
return 0;
}