diff options
author | lloyd <[email protected]> | 2014-12-08 07:21:12 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2014-12-08 07:21:12 +0000 |
commit | e14d04baf0261d5250285fcb6486950078b2c6e7 (patch) | |
tree | faddc8299e5f4c0495418e7b2fb8ad9181965ab0 /src/cmd | |
parent | 1b7dbd5ca22f83ac8011dc209d92d2562562c816 (diff) |
Cleanup for pbe name parsing in PKCS #8 encoder
Diffstat (limited to 'src/cmd')
-rw-r--r-- | src/cmd/keygen.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cmd/keygen.cpp b/src/cmd/keygen.cpp index 6aa74a08f..3054b98ee 100644 --- a/src/cmd/keygen.cpp +++ b/src/cmd/keygen.cpp @@ -61,12 +61,13 @@ Private_Key* gen_key(RandomNumberGenerator& rng, const std::string& algo, size_t int keygen(int argc, char* argv[]) { - OptionParser opts("algo=|bits=|passphrase="); + OptionParser opts("algo=|bits=|passphrase=|pbe="); opts.parse(argv); const std::string algo = opts.value_or_else("algo", "rsa"); const size_t bits = opts.int_value_or_else("bits", 1024); const std::string pass = opts.value_or_else("passphrase", ""); + const std::string pbe = opts.value_or_else("pbe", ""); try { @@ -88,7 +89,7 @@ int keygen(int argc, char* argv[]) if(pass == "") priv << PKCS8::PEM_encode(*key); else - priv << PKCS8::PEM_encode(*key, rng, pass); + priv << PKCS8::PEM_encode(*key, rng, pass, std::chrono::milliseconds(300), pbe); std::cout << "Wrote " << bits << " bit " << algo << " key to public.pem / private.pem\n"; } |